Loading core/lib/Drupal/Core/Test/PhpUnitTestRunner.php +0 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ use Drupal\Core\Database\Database; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Tests\Listeners\SimpletestUiPrinter; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Process\PhpExecutableFinder; Loading Loading @@ -145,8 +144,6 @@ public function runCommand(array $unescaped_test_classnames, $phpunit_file, &$st $phpunit_bin, '--log-junit', escapeshellarg($phpunit_file), '--printer', escapeshellarg(SimpletestUiPrinter::class), ]; // Optimized for running a single test. Loading core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php +21 −0 Original line number Diff line number Diff line Loading @@ -32,4 +32,25 @@ public function testPhpUnitListTests() { ); } /** * Ensures that functional tests produce debug HTML output when required. */ public function testFunctionalTestDebugHtmlOutput() { if (getenv('BROWSERTEST_OUTPUT_DIRECTORY') === FALSE) { $this->markTestSkipped('This test requires the environment variable BROWSERTEST_OUTPUT_DIRECTORY to be set.'); } $process = Process::fromShellCommandline('vendor/bin/phpunit --configuration core --verbose core/modules/image/tests/src/Functional/ImageDimensionsTest.php'); $process->setWorkingDirectory($this->root) ->setTimeout(300) ->setIdleTimeout(300); $process->run(); $this->assertEquals(0, $process->getExitCode(), 'COMMAND: ' . $process->getCommandLine() . "\n" . 'OUTPUT: ' . $process->getOutput() . "\n" . 'ERROR: ' . $process->getErrorOutput() . "\n"); $this->assertStringContainsString('HTML output was generated', $process->getOutput()); $this->assertStringContainsString('Drupal_Tests_image_Functional_ImageDimensionsTest-1', $process->getOutput()); } } core/tests/Drupal/Tests/Listeners/HtmlOutputPrinterTrait.php +0 −16 Original line number Diff line number Diff line Loading @@ -2,8 +2,6 @@ namespace Drupal\Tests\Listeners; use Drupal\Component\Utility\Html; /** * Defines a class for providing html output results for functional tests. * Loading Loading @@ -80,18 +78,4 @@ protected function printHtmlOutput() { } } /** * Prints HTML output links for the Simpletest UI. */ public function simpletestUiWrite($buffer) { $buffer = Html::escape($buffer); // Turn HTML output URLs into clickable link <a> tags. $url_pattern = '@https?://[^\s]+@'; $buffer = preg_replace($url_pattern, '<a href="$0" target="_blank" title="$0">$0</a>', $buffer); // Make the output readable in HTML by breaking up lines properly. $buffer = nl2br($buffer); print $buffer; } } core/tests/Drupal/Tests/Listeners/SimpletestUiPrinter.phpdeleted 100644 → 0 +0 −17 Original line number Diff line number Diff line <?php namespace Drupal\Tests\Listeners; /** * Defines a class for providing html output links in the Simpletest UI. */ class SimpletestUiPrinter extends HtmlOutputPrinter { /** * {@inheritdoc} */ public function write(string $buffer): void { $this->simpletestUiWrite($buffer); } } Loading
core/lib/Drupal/Core/Test/PhpUnitTestRunner.php +0 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ use Drupal\Core\Database\Database; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Tests\Listeners\SimpletestUiPrinter; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Process\PhpExecutableFinder; Loading Loading @@ -145,8 +144,6 @@ public function runCommand(array $unescaped_test_classnames, $phpunit_file, &$st $phpunit_bin, '--log-junit', escapeshellarg($phpunit_file), '--printer', escapeshellarg(SimpletestUiPrinter::class), ]; // Optimized for running a single test. Loading
core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php +21 −0 Original line number Diff line number Diff line Loading @@ -32,4 +32,25 @@ public function testPhpUnitListTests() { ); } /** * Ensures that functional tests produce debug HTML output when required. */ public function testFunctionalTestDebugHtmlOutput() { if (getenv('BROWSERTEST_OUTPUT_DIRECTORY') === FALSE) { $this->markTestSkipped('This test requires the environment variable BROWSERTEST_OUTPUT_DIRECTORY to be set.'); } $process = Process::fromShellCommandline('vendor/bin/phpunit --configuration core --verbose core/modules/image/tests/src/Functional/ImageDimensionsTest.php'); $process->setWorkingDirectory($this->root) ->setTimeout(300) ->setIdleTimeout(300); $process->run(); $this->assertEquals(0, $process->getExitCode(), 'COMMAND: ' . $process->getCommandLine() . "\n" . 'OUTPUT: ' . $process->getOutput() . "\n" . 'ERROR: ' . $process->getErrorOutput() . "\n"); $this->assertStringContainsString('HTML output was generated', $process->getOutput()); $this->assertStringContainsString('Drupal_Tests_image_Functional_ImageDimensionsTest-1', $process->getOutput()); } }
core/tests/Drupal/Tests/Listeners/HtmlOutputPrinterTrait.php +0 −16 Original line number Diff line number Diff line Loading @@ -2,8 +2,6 @@ namespace Drupal\Tests\Listeners; use Drupal\Component\Utility\Html; /** * Defines a class for providing html output results for functional tests. * Loading Loading @@ -80,18 +78,4 @@ protected function printHtmlOutput() { } } /** * Prints HTML output links for the Simpletest UI. */ public function simpletestUiWrite($buffer) { $buffer = Html::escape($buffer); // Turn HTML output URLs into clickable link <a> tags. $url_pattern = '@https?://[^\s]+@'; $buffer = preg_replace($url_pattern, '<a href="$0" target="_blank" title="$0">$0</a>', $buffer); // Make the output readable in HTML by breaking up lines properly. $buffer = nl2br($buffer); print $buffer; } }
core/tests/Drupal/Tests/Listeners/SimpletestUiPrinter.phpdeleted 100644 → 0 +0 −17 Original line number Diff line number Diff line <?php namespace Drupal\Tests\Listeners; /** * Defines a class for providing html output links in the Simpletest UI. */ class SimpletestUiPrinter extends HtmlOutputPrinter { /** * {@inheritdoc} */ public function write(string $buffer): void { $this->simpletestUiWrite($buffer); } }