shell_test.php.svn-base

来自「PHP 知识管理系统(基于树结构的知识管理系统), 英文原版的PHP源码。」· SVN-BASE 代码 · 共 38 行

SVN-BASE
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');    }}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?