cvs: pear-core /tests/PEAR_Command_Config/config-set test.phpt

From: Date: Fri, 26 Nov 2004 21:02:49 +0000
Subject: cvs: pear-core /tests/PEAR_Command_Config/config-set test.phpt
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-26545@lists.php.net to get a copy of this message
cellog Fri Nov 26 16:02:49 2004 EDT Modified files: /pear-core/tests/PEAR_Command_Config/config-set test.phpt Log: add save test http://cvs.php.net/diff.php/pear-core/tests/PEAR_Command_Config/config-set/test.phpt?r1=1.1&r2=1.2&ty=u Index: pear-core/tests/PEAR_Command_Config/config-set/test.phpt diff -u pear-core/tests/PEAR_Command_Config/config-set/test.phpt:1.1 pear-core/tests/PEAR_Command_Config/config-set/test.phpt:1.2 --- pear-core/tests/PEAR_Command_Config/config-set/test.phpt:1.1 Fri Nov 26 15:36:02 2004 +++ pear-core/tests/PEAR_Command_Config/config-set/test.phpt Fri Nov 26 16:02:49 2004 @@ -21,7 +21,23 @@ ), ), $fakelog->getLog(), 'ui log'); $phpunit->assertEquals('poo', $config->get('php_dir'), 'php_dir'); -$phpunit->assertEquals(null, $config->get('php_dir', 'system'), 'setup system'); + +$configinfo = array('master_server' => $server, + 'preferred_state' => 'stable', + 'cache_dir' => $temp_path . DIRECTORY_SEPARATOR . 'cache', + 'php_dir' => 'poo', + 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext', + 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data', + 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc', + 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test', + 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin', + '__channels' => array('__uri' => array())); + +$info = explode("\n", implode('', file($temp_path . DIRECTORY_SEPARATOR . 'pear.ini'))); +$info = unserialize($info[1]); +$phpunit->assertEquals($configinfo, $info, 'saved 1'); + +$phpunit->assertEquals($temp_path . DIRECTORY_SEPARATOR . 'php', $config->get('php_dir', 'system'), 'setup system'); $command->run('config-set', array(), array('php_dir', 'poo', 'system')); $phpunit->assertNoErrors('after'); $phpunit->assertEquals(array ( @@ -32,6 +48,20 @@ ), ), $fakelog->getLog(), 'ui log'); $phpunit->assertEquals('poo', $config->get('php_dir', 'system'), 'php_dir'); +$configinfo = array('master_server' => $server, + 'preferred_state' => 'stable', + 'cache_dir' => $temp_path . DIRECTORY_SEPARATOR . 'cache', + 'php_dir' => 'poo', + 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext', + 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data', + 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc', + 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test', + 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin', + '__channels' => array('__uri' => array())); + +$info = explode("\n", implode('', file($temp_path . DIRECTORY_SEPARATOR . 'pear.conf'))); +$info = unserialize($info[1]); +$phpunit->assertEquals($configinfo, $info, 'saved 2'); echo 'tests done'; ?> --EXPECT--

« previous php.pear.cvs (#26545) next »