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