Creates an empty test case. Should be subclassed with test methods for a functional test case.
ShellTestCase
__construct
([string $label = false])
-
string
$label: Name of test case. Will use the class name if none specified.
Redefinition of:
- SimpleTestCase::__construct()
- Sets up the test with no display.
Will trigger a pass if the two parameters have the same value only. Otherwise a fail. This is for testing hand extracted text, etc.
boolean
assertEqual
(mixed $first, mixed $second, [string $message = "%s"])
-
mixed
$first: Value to compare.
-
mixed
$second: Value to compare.
-
string
$message: Message to display.
Tests the last status code from the shell.
boolean
assertExitCode
(integer $status, [string $message = "%s"])
-
integer
$status: Expected status of last command.
-
string
$message: Message to display.
Will be true on false and vice versa. False is the PHP definition of false, so that null, empty strings, zero and an empty array all count as false.
boolean
assertFalse
(boolean $result, [string $message = '%s'])
-
boolean
$result: Pass on false.
-
string
$message: Message to display.
File existence check.
boolean
assertFileExists
(string $path, [string $message = "%s"])
-
string
$path: Full filename and path.
-
string
$message: Message to display.
File non-existence check.
boolean
assertFileNotExists
(string $path, [string $message = "%s"])
-
string
$path: Full filename and path.
-
string
$message: Message to display.
Scans a file for a Perl regex. If found anywhere it passes, else it fails.
boolean
assertFilePattern
(string $pattern, string $path, [string $message = "%s"])
-
string
$pattern: Regex to search for.
-
string
$path: Full filename and path.
-
string
$message: Message to display.
If a Perl regex is found anywhere in the named file then a failure is generated, else a pass.
boolean
assertNoFilePattern
(string $pattern, string $path, [string $message = "%s"])
-
string
$pattern: Regex to search for.
-
string
$path: Full filename and path.
-
string
$message: Message to display.
If a Perl regex is found anywhere in the current output then a failure is generated, else a pass.
boolean
assertNoOutputPattern
(string $pattern, [$message $message = "%s"])
-
string
$pattern: Regex to search for.
-
$message
$message: Message to display.
Will trigger a pass if the two parameters have a different value. Otherwise a fail. This is for testing hand extracted text, etc.
boolean
assertNotEqual
(mixed $first, mixed $second, [string $message = "%s"])
-
mixed
$first: Value to compare.
-
mixed
$second: Value to compare.
-
string
$message: Message to display.
Attempt to exactly match the combined STDERR and STDOUT output.
boolean
assertOutput
(string $expected, [string $message = "%s"])
-
string
$expected: Expected output.
-
string
$message: Message to display.
Scans the output for a Perl regex. If found anywhere it passes, else it fails.
boolean
assertOutputPattern
(string $pattern, [string $message = "%s"])
-
string
$pattern: Regex to search for.
-
string
$message: Message to display.
Called from within the test methods to register passes and failures.
boolean
assertTrue
(boolean $result, [string $message = false])
-
boolean
$result: Pass on true.
-
string
$message: Message to display describing the test state.
Factory for the shell to run the command on.
Shell
createShell
()
Dumps the output of the last command.
void
dumpOutput
()
Executes a command and buffers the results.
boolean
execute
(string $command)
-
string
$command: Command to run.
Accessor for the last output.
string
getOutput
()
Accessor for the last output.
array
getOutputAsList
()
Accessor for current shell. Used for testing the the tester itself.
Shell
getShell
()
Inherited Methods
Inherited From SimpleTestCase
SimpleTestCase::__construct()
SimpleTestCase::after()
SimpleTestCase::assert()
SimpleTestCase::before()
SimpleTestCase::createInvoker()
SimpleTestCase::dump()
SimpleTestCase::error()
SimpleTestCase::exception()
SimpleTestCase::fail()
SimpleTestCase::getAssertionLine()
SimpleTestCase::getLabel()
SimpleTestCase::getSize()
SimpleTestCase::getTests()
SimpleTestCase::isTest()
SimpleTestCase::pass()
SimpleTestCase::run()
SimpleTestCase::setUp()
SimpleTestCase::shouldSkip()
SimpleTestCase::signal()
SimpleTestCase::skip()
SimpleTestCase::skipIf()
SimpleTestCase::skipUnless()
SimpleTestCase::tearDown()
SimpleTestCase::tell()