Mercurial > hg > isophonics-drupal-site
view core/modules/simpletest/src/Tests/UiPhpUnitOutputTest.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | af1871eacc83 |
children |
line wrap: on
line source
<?php namespace Drupal\simpletest\Tests; use Drupal\simpletest\WebTestBase; use Drupal\Tests\simpletest\Functional\SimpletestPhpunitBrowserTest; /** * Test PHPUnit output for the Simpletest UI. * * @group simpletest * * @see \Drupal\Tests\Listeners\SimpletestUiPrinter */ class UiPhpUnitOutputTest extends WebTestBase { /** * Modules to enable. * * @var string[] */ public static $modules = ['simpletest']; /** * Tests that PHPUnit output in the Simpletest UI looks good. */ public function testOutput() { require_once __DIR__ . '/../../tests/fixtures/simpletest_phpunit_browsertest.php'; $phpunit_junit_file = $this->container->get('file_system')->realpath('public://phpunit_junit.xml'); // Prepare the default browser test output directory in the child site. $this->container->get('file_system')->mkdir('public://simpletest'); $status = 0; $output = []; simpletest_phpunit_run_command([SimpletestPhpunitBrowserTest::class], $phpunit_junit_file, $status, $output); // Check that there are <br> tags for the HTML output by // SimpletestUiPrinter. $this->assertEqual($output[20], 'HTML output was generated<br />'); // Check that URLs are printed as HTML links. $this->assertIdentical(strpos($output[21], '<a href="http'), 0); } }