From 55c4ac1bfe565f1ca7f537fdd8b7a201be28e581 Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 10 Nov 2005 12:47:19 +0000 Subject: Initial import of prado framework --- .../simpletest/test/shell_tester_test.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/UnitTests/simpletest/test/shell_tester_test.php (limited to 'tests/UnitTests/simpletest/test/shell_tester_test.php') diff --git a/tests/UnitTests/simpletest/test/shell_tester_test.php b/tests/UnitTests/simpletest/test/shell_tester_test.php new file mode 100644 index 00000000..5a8f5b59 --- /dev/null +++ b/tests/UnitTests/simpletest/test/shell_tester_test.php @@ -0,0 +1,37 @@ +_mock_shell; + } + + function testExitCode() { + $this->_mock_shell = &new MockSimpleShell($this); + $this->_mock_shell->setReturnValue('execute', 0); + $this->_mock_shell->expectOnce('execute', array('ls')); + $this->assertTrue($this->execute('ls')); + $this->assertExitCode(0); + $this->_mock_shell->tally(); + } + + function testOutput() { + $this->_mock_shell = &new MockSimpleShell($this); + $this->_mock_shell->setReturnValue('execute', 0); + $this->_mock_shell->setReturnValue('getOutput', "Line 1\nLine 2\n"); + $this->assertOutput("Line 1\nLine 2\n"); + } + + function testOutputPatterns() { + $this->_mock_shell = &new MockSimpleShell($this); + $this->_mock_shell->setReturnValue('execute', 0); + $this->_mock_shell->setReturnValue('getOutput', "Line 1\nLine 2\n"); + $this->assertOutputPattern('/line/i'); + $this->assertNoOutputPattern('/line 2/'); + } + } +?> \ No newline at end of file -- cgit v1.2.3