FOSSology
4.5.1
Open Source License Compliance by Open Source Software
parameters.php
1
<?php
2
/*
3
SPDX-FileCopyrightText: © 2007 Hewlett-Packard Development Company, L.P.
4
5
SPDX-License-Identifier: GPL-2.0-only
6
*/
7
17
class
TestCLInputCP2foss
extends
UnitTestCase
18
{
19
20
public
$command =
'/usr/local/bin/test.cp2foss'
;
21
22
function
Testhnpa()
23
{
24
25
$help = exec(
"$this->command -h"
, $output, $retval);
26
//print_r($output);
27
$this->assertPattern(
'/Usage: cp2foss/'
, $output[0]);
28
$output = array();
29
$error = exec(
"$this->command -n foo -a /bar/baz -d 'a comment'"
, $output, $retval);
30
//print_r($output);
31
$this->assertPattern(
'/ERROR, -p /'
, $output[0]);
32
$output = array();
33
$error = exec(
"$this->command -p foo -a /bar/baz -d \"a comment\""
, $output, $retval);
34
//print_r($output);
35
$this->assertPattern(
'/ERROR, -n /'
, $output[0]);
36
$output = array();
37
$error = exec(
"$this->command -p baz -n foo -d 'a comment'"
, $output, $retval);
38
//print_r($output);
39
$this->assertPattern(
'/ERROR, -a /'
, $output[0]);
40
}
41
42
function
TestMissingDashP()
43
{
44
45
// Note you must have a valid archive
46
$error = exec(
"$this->command -n foo -a /tmp/zlib.tar.bz2 -d 'a comment'"
, $output, $retval);
47
//print_r($output);
48
$this->assertPattern(
'/ERROR, -p /'
, $output[0]);
49
}
50
51
function
TestMissingDashN()
52
{
53
54
// Note you must have a valid archive
55
$error = exec(
"$this->command -p foo -a /tmp/zlib.tar.bz2 -d 'a comment'"
, $output, $retval);
56
//print_r($output);
57
$this->assertPattern(
'/ERROR, -n /'
, $output[0]);
58
}
59
60
function
TestMissingDasha()
61
{
62
// Note you must have a valid archive
63
$error = exec(
"$this->command -p baz -n foo -d 'a comment'"
, $output, $retval);
64
//print_r($output);
65
$this->assertPattern(
'/ERROR, -a /'
, $output[0]);
66
}
67
}
68
TestCLInputCP2foss
Definition:
1stest.php:13
src
cli
tests
parameters.php
Generated on Wed Mar 26 2025 09:10:51 for FOSSology by
1.9.1