cvs: pear-core /tests/PEAR_Command test_setFrontendClass.phpt
| From: | Greg Beaver | Date: | Fri, 26 Nov 2004 19:54:30 +0000 |
| Subject: | cvs: pear-core /tests/PEAR_Command test_setFrontendClass.phpt | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-26536@lists.php.net to get a copy of this message | ||
cellog Fri Nov 26 14:54:30 2004 EDT
Added files:
/pear-core/tests/PEAR_Command test_setFrontendClass.phpt
Log:
new test (finish PEAR_Command tests)
http://cvs.php.net/co.php/pear-core/tests/PEAR_Command/test_setFrontendClass.phpt?r=1.1&p=1
Index: pear-core/tests/PEAR_Command/test_setFrontendClass.phpt
+++ pear-core/tests/PEAR_Command/test_setFrontendClass.phpt
--TEST--
PEAR_Command::setFrontendClass()
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
echo 'skip';
}
?>
--FILE--
<?php
error_reporting(E_ALL);
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$err = &PEAR_Command::setFrontendClass('foo_gobrmlble');
$phpunit->assertErrors(array(
array('package' => 'PEAR_Error', 'message' => 'no such
class: foo_gobrmlble')
), 'invalid');
class invalid_frontend {
function noUserConfirm()
{
}
}
$err = &PEAR_Command::setFrontendClass('invalid_frontend');
$phpunit->assertErrors(array(
array('package' => 'PEAR_Error', 'message' => 'not a
frontend class: invalid_frontend')
), 'not a frontend');
$ok = &PEAR_Command::setFrontendClass('PEAR_Frontend_CLI');
$phpunit->assertIsa('PEAR_Frontend_CLI', $ok, 'ok');
echo 'tests done';
?>
--EXPECT--
tests done