3 namespace Drupal\simpletest\Tests;
5 use Drupal\simpletest\WebTestBase;
6 use Drupal\Tests\simpletest\Functional\SimpletestPhpunitBrowserTest;
9 * Test PHPUnit output for the Simpletest UI.
13 * @see \Drupal\Tests\Listeners\SimpletestUiPrinter
15 class UiPhpUnitOutputTest extends WebTestBase {
22 public static $modules = ['simpletest'];
25 * Tests that PHPUnit output in the Simpletest UI looks good.
27 public function testOutput() {
28 require_once __DIR__ . '/../../tests/fixtures/simpletest_phpunit_browsertest.php';
29 $phpunit_junit_file = $this->container->get('file_system')->realpath('public://phpunit_junit.xml');
30 // Prepare the default browser test output directory in the child site.
31 $this->container->get('file_system')->mkdir('public://simpletest');
34 simpletest_phpunit_run_command([SimpletestPhpunitBrowserTest::class], $phpunit_junit_file, $status, $output);
36 // Check that there are <br> tags for the HTML output by
37 // SimpletestUiPrinter.
38 $this->assertEqual($output[19], 'HTML output was generated<br />');
39 // Check that URLs are printed as HTML links.
40 $this->assertIdentical(strpos($output[20], '<a href="http'), 0);