-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
When we chose the method of test runner " TestRunnerHTML ()" this does not work well because the line code: $this->run(); is not in the " TestRunnerHTML.php " file.
Here the solution and use:
1.
In the "TestRunnerHTML.php" file, modify the function get_output()
<?php
class TestRunnerHTML extends TestRunner
{
protected $total_results = 0;
protected $total_failed = 0;
protected $total_assertions = 0;
public function get_output()
{
$this-> run(); //**Add this line**
$output = "";
foreach($this->get_results() as $case_name => $test_results)
{
$output .= $this->get_case_results($case_name, $test_results);
}
return $this->summary().$output;
}...
In the test script in step three (3) , change the method of test runner and then print the HTML echo result , as detailed below:
// 3. Choose a TestRunner and add your TestCase
$runner = new TestRunnerHTML();
$runner ->add_test_case(new TestCaseMyClass());
echo $runner->get_output(); //**Print the result HTML**
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels