mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-20 11:49:56 +09:00
#17528788 : unittest framework added
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6001 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
ea7c87ec0d
commit
7619bce790
99 changed files with 31041 additions and 0 deletions
38
tests/simpletest/test/shell_test.php
Normal file
38
tests/simpletest/test/shell_test.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
// $Id: shell_test.php 1529 2007-06-04 18:33:09Z lastcraft $
|
||||
require_once(dirname(__FILE__) . '/../autorun.php');
|
||||
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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue