PhpUnitTestRunner
class PhpUnitTestRunner implements ContainerInjectionInterface (View source)
Run PHPUnit-based tests.
This class runs PHPUnit-based tests and converts their JUnit results to a format that can be stored in the {simpletest} database schema.
This class is @internal and not considered to be API.
Properties
| protected string | $workingDirectory | Path to the working directory. |
|
| protected string | $appRoot | Path to the application root. |
Methods
Instantiates a new instance of this class.
Constructs a test runner.
Returns the path to use for PHPUnit's --log-junit option.
Returns the command to run PHPUnit.
Executes the PHPUnit command.
Executes PHPUnit tests and returns the results of the run.
Tallies test results per test class.
Details
static
create(ContainerInterface $container)
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
__construct(string $app_root, string $working_directory)
Constructs a test runner.
string
xmlLogFilePath(int $test_id)
| internal |
Returns the path to use for PHPUnit's --log-junit option.
string
phpUnitCommand()
| internal |
Returns the command to run PHPUnit.
string
runCommand(array $unescaped_test_classnames, string $phpunit_file, int $status = NULL, string[] $output = NULL)
| internal |
Executes the PHPUnit command.
array
runTests(int $test_id, array $unescaped_test_classnames, int $status = NULL)
| internal |
Executes PHPUnit tests and returns the results of the run.
int[][]
summarizeResults(array $results)
| internal |
Tallies test results per test class.