diff options
author | wclouser@mozilla.com <wclouser@mozilla.com@4eb1ac78-321c-0410-a911-ec516a8615a5> | 2009-06-10 04:17:09 (GMT) |
---|---|---|
committer | wclouser@mozilla.com <wclouser@mozilla.com@4eb1ac78-321c-0410-a911-ec516a8615a5> | 2009-06-10 04:17:09 (GMT) |
commit | ee24d0e4d4e6ee577df1388c6668e76ef7861579 (patch) | |
tree | 737a3e38100e82f2c85f8d5e833136ce18bdbcc6 /site/vendors/simpletest/test/shell_test.php |
Tag 5.0.6 for production
git-svn-id: http://svn.mozilla.org/addons/trunk@27440 4eb1ac78-321c-0410-a911-ec516a8615a5
Diffstat (limited to 'site/vendors/simpletest/test/shell_test.php')
-rw-r--r-- | site/vendors/simpletest/test/shell_test.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/site/vendors/simpletest/test/shell_test.php b/site/vendors/simpletest/test/shell_test.php new file mode 100644 index 0000000..6199272 --- /dev/null +++ b/site/vendors/simpletest/test/shell_test.php @@ -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'); + } +} +?>
\ No newline at end of file |