Skip to content

Commit

Permalink
test for bug18102
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnazg committed Apr 26, 2017
1 parent 9968411 commit d1af572
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tests/PEAR_Command_Install/install/packages/badpackage.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0"-->
<package version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/package-1.0 http://pear.php.net/dtd/package-1.0.xsd">
<name>PEAR</name>
<summary>PEAR Base System</summary>
<description>The PEAR package contains:
* the PEAR installer, for creating, distributing
and installing packages
* the alpha-quality PEAR_Exception PHP5 error handling mechanism
* the beta-quality PEAR_ErrorStack advanced error handling mechanism
* the PEAR_Error error handling mechanism
* the OS_Guess class for retrieving info about the OS
where PHP is running on
* the System class for quick handling of common operations
with files and directories
* the PEAR base class
</description>
<maintainers>
<maintainer>
<user>ssb</user>
<role>lead</role>
<name>Stig Bakken</name>
<email>[email protected]</email>
</maintainer>
</maintainers>
<release>
<version>1.4.0a1</version>
<date>2004-10-21</date>
<license>PHP License</license>
<state>alpha</state>
<notes>
(dummy notes)
</notes>
<filelist>
<dir name="/">
<file name="not-a-file.php" role="php"/>
</dir>
</filelist>
</release>
<changelog/>
</package>
24 changes: 24 additions & 0 deletions tests/PEAR_Command_Install/install/test_bug18102.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--TEST--
Bug #18102: pear install does not fail on error
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
echo 'skip';
}
?>
--FILE--
<?php

require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$pathtopackagexml = dirname(__FILE__) . DIRECTORY_SEPARATOR .
'packages'. DIRECTORY_SEPARATOR . 'badpackage.xml';
$res = $command->run('install', array(), array($pathtopackagexml));
$phpunit->assertPEARError($res, 'should be error');
echo 'tests done';
?>
--CLEAN--
<?php
require_once dirname(dirname(__FILE__)) . '/teardown.php.inc';
?>
--EXPECT--
tests done

0 comments on commit d1af572

Please sign in to comment.