1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
--TEST--
download command failure
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
echo 'skip';
}
?>
--FILE--
<?php
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$reg = &$config->getRegistry();
$e = $command->run('download', array(), array('http://www.example.com/bloo.tgz'));
$phpunit->assertErrors(array(
array('package' => 'PEAR_Error', 'message' => 'download failed'),
), '404');
$phpunit->assertEquals( array (
array (
0 => 3,
1 => 'Downloading "http://www.example.com/bloo.tgz"',
),
array (
0 => 0,
1 => 'Could not download from "http://www.example.com/bloo.tgz" (File http://www.example.com:80/bloo.tgz not valid (received: HTTP/1.1 404 http://www.example.com/bloo.tgz Is not valid))',
),
array (
0 => 0,
1 => 'Invalid or missing remote package file',
),
array (
0 => 2,
1 => 'Package "http://www.example.com/bloo.tgz" is not valid',
),
)
, $fakelog->getLog(), 'log');
echo 'tests done';
?>
--CLEAN--
<?php
require_once dirname(dirname(__FILE__)) . '/teardown.php.inc';
?>
--EXPECT--
tests done
|