simpletest_phpunit_run_command_test.php 814 B

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