TestRunner
class TestRunner
Class that contains functions that can be used by runner child classes.
Constants
| ALLOWED_OPTIONS |
The array of options allowed as input for the test command. |
Properties
| protected string | $inputOptions | A string of input options provided as input when running the test command. |
|
| protected OutputInterface | $output | The Symfony OutputInterface object. |
Methods
Constructor
Test to ensure there is not an empty test suite.
Performs all available tests.
Present message to the user if the following conditions are true:
- Test case files in multiple suites with the same name
- There exists a function in both classes with the same name
Retrieves all files in test suite so they can be run.
Alerts use if there are no available tests to perform.
Runs the unit test for your testing suite.
Supports ability to run test by class/file name.
Performs testing against a single class within a test suite.
Determine if test file exists in any of the available test suites.
Enforces rule that classes/files across test suites should be unique for filtering.
Run all test files in an individual test suite.
Determines if execution of a test suite(s) is successful. The result is determined by testing if the status value is set and its integer value is equal to Command::SUCCESS.
Ensure filter syntax is correct. Does not test if only one : is in string.
Details
at line 39
__construct(OutputInterface $output)
Constructor
at line 51
bool
areAllSuitesEmpty(array $testSuites)
Test to ensure there is not an empty test suite.
at line 67
int
allTests(array $testSuites, string|array $extensions, string $testCommand)
Performs all available tests.
at line 107
static private void
duplicateTestNameMessage()
Present message to the user if the following conditions are true:
- Test case files in multiple suites with the same name
- There exists a function in both classes with the same name
This function is called internally by the selectTest function.
at line 121
static array
getAllTestsInSuite(string $path, string $ext)
Retrieves all files in test suite so they can be run.
at line 130
private void
noAvailableTestsMessage()
Alerts use if there are no available tests to perform.
at line 141
void
runTest(string $test, string $testCommand)
Runs the unit test for your testing suite.
at line 158
int
selectByTestName(string $testArg, array $testSuites, string|array $extensions, string $testCommand)
Supports ability to run test by class/file name.
at line 204
int
singleFileWithinSuite(string $testArg, string $testSuite, string $ext, string $command)
Performs testing against a single class within a test suite.
at line 223
static bool
testExists(string $name, array $testSuites, string|array $extensions)
Determine if test file exists in any of the available test suites.
at line 252
static bool
testIfSame(string $name, array $testSuites, string|array $extension)
Enforces rule that classes/files across test suites should be unique for filtering.
at line 283
int
testSuite(array $collection, string $testCommand)
Run all test files in an individual test suite.
at line 305
static bool
testSuiteStatus(array $suiteStatuses)
Determines if execution of a test suite(s) is successful. The result is determined by testing if the status value is set and its integer value is equal to Command::SUCCESS.
at line 318
static bool
verifyFilterSyntax(string $testArg)
Ensure filter syntax is correct. Does not test if only one : is in string.