1
0
mirror of synced 2024-12-14 15:16:04 +03:00
doctrine2/vendor/simpletest/test/shell_test.php
2007-01-28 22:39:21 +00:00

38 lines
1.3 KiB
PHP

<?php
// $Id: shell_test.php,v 1.8 2004/09/24 22:55:18 lastcraft Exp $
require_once(dirname(__FILE__) . '/../shell_tester.php');
class TestOfShell extends UnitTestCase {
function testEcho() {
$shell = &new SimpleShell();
$this->assertIdentical($shell->execute('echo Hello'), 0);
$this->assertWantedPattern('/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');
}
}
?>