simpletest_phpunit_run_command_test.php 835 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. // phpcs:ignoreFile
  3. namespace Drupal\Tests\simpletest\Unit;
  4. use Drupal\Tests\UnitTestCase;
  5. /**
  6. * This test crashes PHP.
  7. *
  8. * To avoid accidentally running, it is not in a normal PSR-4 directory, the
  9. * file name does not adhere to PSR-4 and an environment variable also needs to
  10. * be set for the crash to happen.
  11. *
  12. * @see \Drupal\Tests\simpletest\Unit\SimpletestPhpunitRunCommandTest::testSimpletestPhpUnitRunCommand()
  13. */
  14. class SimpletestPhpunitRunCommandTestWillDie extends UnitTestCase {
  15. /**
  16. * Performs the status specified by SimpletestPhpunitRunCommandTestWillDie.
  17. */
  18. public function testWillDie() {
  19. $status = (int) getenv('SimpletestPhpunitRunCommandTestWillDie');
  20. if ($status == 0) {
  21. $this->assertTrue(TRUE, 'Assertion to ensure test pass');
  22. return;
  23. }
  24. exit($status);
  25. }
  26. }