cvs: pear-core(PEAR_1_4) /tests/PEAR_Command_Install/install test_dependsonpecl.phpt

From: Date: Sat, 15 Jul 2006 00:16:53 +0000
Subject: cvs: pear-core(PEAR_1_4) /tests/PEAR_Command_Install/install test_dependsonpecl.phpt
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-4854@lists.php.net to get a copy of this message
pajoye Sat Jul 15 00:16:53 2006 UTC Modified files: (Branch: PEAR_1_4) /pear-core/tests/PEAR_Command_Install/install test_dependsonpecl.phpt Log: - fix test, downloaddir http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_Command_Install/install/test_dependsonpecl.phpt?r1=1.6&r2=1.6.2.1&diff_format=u Index: pear-core/tests/PEAR_Command_Install/install/test_dependsonpecl.phpt diff -u pear-core/tests/PEAR_Command_Install/install/test_dependsonpecl.phpt:1.6 pear-core/tests/PEAR_Command_Install/install/test_dependsonpecl.phpt:1.6.2.1 --- pear-core/tests/PEAR_Command_Install/install/test_dependsonpecl.phpt:1.6 Fri Feb 3 05:01:48 2006 +++ pear-core/tests/PEAR_Command_Install/install/test_dependsonpecl.phpt Sat Jul 15 00:16:53 2006 @@ -19,7 +19,7 @@ PEAR::pushErrorHandling(PEAR_ERROR_RETURN); $pearweb->addXmlrpcConfig("pear.php.net", "package.getDepDownloadURL", array ( 0 => '1.0', - 1 => + 1 => array ( 'type' => 'pkg', 'rel' => 'has', @@ -27,7 +27,7 @@ 'channel' => 'pear.php.net', 'package' => 'radius', ), - 2 => + 2 => array ( 'channel' => 'pear.php.net', 'package' => 'PEAR', @@ -38,12 +38,12 @@ PEAR::popErrorHandling(); $pearweb->addXmlrpcConfig("pecl.php.net", "package.getDepDownloadURL", array ( 0 => '2.0', - 1 => + 1 => array ( 'channel' => 'pecl.php.net', 'name' => 'radius', ), - 2 => + 2 => array ( 'channel' => 'pear.php.net', 'package' => 'PEAR', @@ -105,52 +105,124 @@ array('package' => 'PEAR_PackageFile_v2', 'message' => 'Channel validator warning: field "providesextension" - package name "peclpkg" is different from extension name "extpkg"'), ), 'after install'); $dl = &$command->getDownloader(1, array()); -$phpunit->assertEquals(array ( - 0 => - array ( - 0 => 3, - 1 => '+ tmp dir created at ' . $dl->getDownloadDir(), - ), - 1 => - array ( - 0 => 3, - 1 => 'Notice: package "pear/PEAR" required dependency "pecl/radius" will not be automatically downloaded', - ), - 2 => - array ( - 0 => 1, - 1 => 'Did not download dependencies: pecl/radius, use --alldeps or --onlyreqdeps to download automatically', - ), - 3 => - array ( - 0 => 0, - 1 => 'pear/PEAR requires package "pear/radius"', - ), - 4 => - array ( - 'info' => - array ( - 'data' => + +$dd_dir = $dl->getDownloadDir(); +if (!empty($dd_dir) && is_dir($dd_dir)) { + $phpunit->assertEquals(array ( array ( - 0 => + 0 => 3, + 1 => 'Notice: package "pear/PEAR" required dependency "pecl/radius" will not be automatically downloaded', + ), + array ( + 0 => 1, + 1 => 'Did not download dependencies: pecl/radius, use --alldeps or --onlyreqdeps to download automatically', + ), + array ( + 0 => 0, + 1 => 'pear/PEAR requires package "pear/radius"', + ), + array ( + 'info' => array ( - 0 => 'No valid packages found', + 'data' => + array ( + 0 => + array ( + 0 => 'No valid packages found', + ), + ), + 'headline' => 'Install Errors', ), + 'cmd' => 'no command', ), - 'headline' => 'Install Errors', - ), - 'cmd' => 'no command', - ), -), $fakelog->getLog(), 'log messages'); + ), $fakelog->getLog(), 'log messages'); +} else { + $phpunit->assertEquals(array ( + 0 => + array ( + 0 => 3, + 1 => '+ tmp dir created at ' . $dl->getDownloadDir(), + ), + 1 => + array ( + 0 => 3, + 1 => 'Notice: package "pear/PEAR" required dependency "pecl/radius" will not be automatically downloaded', + ), + 2 => + array ( + 0 => 1, + 1 => 'Did not download dependencies: pecl/radius, use --alldeps or --onlyreqdeps to download automatically', + ), + 3 => + array ( + 0 => 0, + 1 => 'pear/PEAR requires package "pear/radius"', + ), + 4 => + array ( + 'info' => + array ( + 'data' => + array ( + 0 => + array ( + 0 => 'No valid packages found', + ), + ), + 'headline' => 'Install Errors', + ), + 'cmd' => 'no command', + ), + ), $fakelog->getLog(), 'log messages'); + + $phpunit->assertEquals(array ( + 0 => + array ( + 0 => 3, + 1 => '+ tmp dir created at ' . $dl->getDownloadDir(), + ), + 1 => + array ( + 0 => 3, + 1 => 'Notice: package "pear/PEAR" required dependency "pecl/radius" will not be automatically downloaded', + ), + 2 => + array ( + 0 => 1, + 1 => 'Did not download dependencies: pecl/radius, use --alldeps or --onlyreqdeps to download automatically', + ), + 3 => + array ( + 0 => 0, + 1 => 'pear/PEAR requires package "pear/radius"', + ), + 4 => + array ( + 'info' => + array ( + 'data' => + array ( + 0 => + array ( + 0 => 'No valid packages found', + ), + ), + 'headline' => 'Install Errors', + ), + 'cmd' => 'no command', + ), + ), $fakelog->getLog(), 'log messages'); +} + $phpunit->assertEquals( array ( - 0 => + 0 => array ( 0 => 'pear.php.net', 1 => 'package.getDepDownloadURL', - 2 => + 2 => array ( 0 => '1.0', - 1 => + 1 => array ( 'type' => 'pkg', 'rel' => 'has', @@ -158,7 +230,7 @@ 'channel' => 'pear.php.net', 'package' => 'radius', ), - 2 => + 2 => array ( 'channel' => 'pear.php.net', 'package' => 'PEAR', @@ -167,19 +239,19 @@ 3 => 'stable', ), ), - 1 => + 1 => array ( 0 => 'pecl.php.net', 1 => 'package.getDepDownloadURL', - 2 => + 2 => array ( 0 => '2.0', - 1 => + 1 => array ( 'channel' => 'pecl.php.net', 'name' => 'radius', ), - 2 => + 2 => array ( 'channel' => 'pear.php.net', 'package' => 'PEAR',

« previous php.pear.core (#4854) next »