UiPhpUnitOutputTest.php in SimpleTest 8.3
File
src/Tests/UiPhpUnitOutputTest.php
View source
<?php
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\simpletest\Functional\SimpletestPhpunitBrowserTest;
class UiPhpUnitOutputTest extends WebTestBase {
public static $modules = [
'simpletest',
];
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');
$this->container
->get('file_system')
->mkdir('public://simpletest');
$status = 0;
$output = [];
simpletest_phpunit_run_command([
SimpletestPhpunitBrowserTest::class,
], $phpunit_junit_file, $status, $output);
$this
->assertEqual($output[20], 'HTML output was generated<br />');
$this
->assertIdentical(strpos($output[21], '<a href="http'), 0);
}
}