mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
57ef2eba9b
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@430 3807eeeb-6ff5-0310-8944-8be069107fe0
38 lines
No EOL
1.2 KiB
PHP
38 lines
No EOL
1.2 KiB
PHP
<?php
|
|
// $Id$
|
|
|
|
require_once(dirname(__FILE__) . '/../shell_tester.php');
|
|
|
|
class TestOfShell extends UnitTestCase {
|
|
|
|
function testEcho() {
|
|
$shell = &new SimpleShell();
|
|
$this->assertIdentical($shell->execute('echo Hello'), 0);
|
|
$this->assertPattern('/Hello/', $shell->getOutput());
|
|
}
|
|
|
|
function testBadCommand() {
|
|
$shell = &new SimpleShell();
|
|
$this->assertNotEqual($ret = $shell->execute('blurgh! 2>&1'), 0);
|
|
}
|
|
}
|
|
|
|
class TestOfShellTesterAndShell extends ShellTestCase {
|
|
|
|
function testEcho() {
|
|
$this->assertTrue($this->execute('echo Hello'));
|
|
$this->assertExitCode(0);
|
|
$this->assertoutput('Hello');
|
|
}
|
|
|
|
function testFileExistence() {
|
|
$this->assertFileExists(dirname(__FILE__) . '/all_tests.php');
|
|
$this->assertFileNotExists('wibble');
|
|
}
|
|
|
|
function testFilePatterns() {
|
|
$this->assertFilePattern('/all_tests/i', dirname(__FILE__) . '/all_tests.php');
|
|
$this->assertNoFilePattern('/sputnik/i', dirname(__FILE__) . '/all_tests.php');
|
|
}
|
|
}
|
|
?>
|