cvs: pear-core /tests/PEAR_Command_Config/config-help test.phpt /tests/PEAR_Command_Config/config-show test_fail.phpt
| From: | Greg Beaver | Date: | Fri, 26 Nov 2004 21:35:58 +0000 |
| Subject: | cvs: pear-core /tests/PEAR_Command_Config/config-help test.phpt /tests/PEAR_Command_Config/config-show test_fail.phpt | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-26553@lists.php.net to get a copy of this message | ||
cellog Fri Nov 26 16:35:58 2004 EDT
Added files:
/pear-core/tests/PEAR_Command_Config/config-help test.phpt
/pear-core/tests/PEAR_Command_Config/config-show test_fail.phpt
Log:
new tests
http://cvs.php.net/co.php/pear-core/tests/PEAR_Command_Config/config-help/test.phpt?r=1.1&p=1
Index: pear-core/tests/PEAR_Command_Config/config-help/test.phpt
+++ pear-core/tests/PEAR_Command_Config/config-help/test.phpt
--TEST--
config-help command
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
echo 'skip';
}
?>
--FILE--
<?php
error_reporting(E_ALL);
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$e = $command->run('config-help', array(), array());
$phpunit->assertNoErrors('test');
$phpunit->showall();
$phpunit->assertEquals(array (
0 =>
array (
'info' =>
array (
'caption' => 'Config help',
'headline' =>
array (
0 => 'Name',
1 => 'Type',
2 => 'Description',
),
'border' => true,
'data' =>
array (
0 =>
array (
0 => 'master_server',
1 => 'string',
2 => 'name of the main PEAR server [NOT USED IN THIS VERSION]',
),
1 =>
array (
0 => 'preferred_state',
1 => 'set',
2 => 'the installer will prefer releases with this state when installing packages
without a version or state specified
Valid set: stable beta alpha devel snapshot',
),
2 =>
array (
0 => 'cache_dir',
1 => 'directory',
2 => 'directory which is used for XMLRPC cache',
),
3 =>
array (
0 => 'php_dir',
1 => 'directory',
2 => 'directory where .php files are installed',
),
4 =>
array (
0 => 'ext_dir',
1 => 'directory',
2 => 'directory where loadable extensions are installed',
),
5 =>
array (
0 => 'data_dir',
1 => 'directory',
2 => 'directory where data files are installed',
),
6 =>
array (
0 => 'doc_dir',
1 => 'directory',
2 => 'directory where documentation is installed',
),
7 =>
array (
0 => 'test_dir',
1 => 'directory',
2 => 'directory where regression tests are installed',
),
8 =>
array (
0 => 'bin_dir',
1 => 'directory',
2 => 'directory where executables are installed',
),
9 =>
array (
0 => 'default_channel',
1 => 'string',
2 => 'the default channel to use for all non explicit commands',
),
10 =>
array (
0 => 'remote_config',
1 => 'password',
2 => 'ftp url of remote configuration file to use for synchronized install',
),
11 =>
array (
0 => 'auto_discover',
1 => 'integer',
2 => 'whether to automatically discover new channels',
),
12 =>
array (
0 => 'http_proxy',
1 => 'string',
2 => 'HTTP proxy (host:port) to use when downloading packages',
),
13 =>
array (
0 => 'php_bin',
1 => 'file',
2 => 'PHP CLI/CGI binary for executing scripts',
),
14 =>
array (
0 => 'username',
1 => 'string',
2 => '(maintainers) your PEAR account name',
),
15 =>
array (
0 => 'password',
1 => 'password',
2 => '(maintainers) your PEAR account password',
),
16 =>
array (
0 => 'verbose',
1 => 'integer',
2 => 'verbosity level
0: really quiet
1: somewhat quiet
2: verbose
3: debug',
),
17 =>
array (
0 => 'umask',
1 => 'mask',
2 => 'umask used when creating files (Unix-like systems only)',
),
18 =>
array (
0 => 'cache_ttl',
1 => 'integer',
2 => 'amount of secs where the local cache is used and not updated',
),
19 =>
array (
0 => 'sig_type',
1 => 'set',
2 => 'which package signature mechanism to use
Valid set: gpg',
),
20 =>
array (
0 => 'sig_bin',
1 => 'string',
2 => 'which package signature mechanism to use',
),
21 =>
array (
0 => 'sig_keyid',
1 => 'string',
2 => 'which key to use for signing with',
),
22 =>
array (
0 => 'sig_keydir',
1 => 'directory',
2 => 'directory where signature keys are located',
),
),
),
'cmd' => 'config-help',
),
), $fakelog->getLog(), 'log');
echo 'tests done';
?>
--EXPECT--
tests done
http://cvs.php.net/co.php/pear-core/tests/PEAR_Command_Config/config-show/test_fail.phpt?r=1.1&p=1
Index: pear-core/tests/PEAR_Command_Config/config-show/test_fail.phpt
+++ pear-core/tests/PEAR_Command_Config/config-show/test_fail.phpt
--TEST--
config-show command failure
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
echo 'skip';
}
?>
--FILE--
<?php
error_reporting(E_ALL);
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$e = $command->run('config-show', array(), array('gronk'));
$phpunit->assertErrors(array(
array('package' => 'PEAR_Error', 'message' =>
'config-show: only the layers: "user" or "system" are supported'),
), 'unknown layer');
$e = $command->run('config-show', array('channel' => 'gronk'),
array());
$phpunit->assertErrors(array(
array('package' => 'PEAR_Error', 'message' => 'Channel
"gronk" does not exist'),
), 'unknown channel as option');
echo 'tests done';
?>
--EXPECT--
tests done