Chris@0: siteDirectory . '/error.log'); Chris@0: parent::tearDown(); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Test shutdown functions. Chris@0: */ Chris@0: public function testShutdownFunctions() { Chris@0: $arg1 = $this->randomMachineName(); Chris@0: $arg2 = $this->randomMachineName(); Chris@0: $this->drupalGet('system-test/shutdown-functions/' . $arg1 . '/' . $arg2); Chris@0: Chris@0: // If using PHP-FPM then fastcgi_finish_request() will have been fired Chris@0: // returning the response before shutdown functions have fired. Chris@0: // @see \Drupal\system_test\Controller\SystemTestController::shutdownFunctions() Chris@0: $server_using_fastcgi = strpos($this->getRawContent(), 'The function fastcgi_finish_request exists when serving the request.'); Chris@0: if ($server_using_fastcgi) { Chris@0: // We need to wait to ensure that the shutdown functions have fired. Chris@0: sleep(1); Chris@0: } Chris@0: $this->assertEqual(\Drupal::state()->get('_system_test_first_shutdown_function'), [$arg1, $arg2]); Chris@0: $this->assertEqual(\Drupal::state()->get('_system_test_second_shutdown_function'), [$arg1, $arg2]); Chris@0: Chris@0: if (!$server_using_fastcgi) { Chris@0: // Make sure exceptions displayed through Chris@0: // \Drupal\Core\Utility\Error::renderExceptionSafe() are correctly Chris@0: // escaped. Chris@0: $this->assertRaw('Drupal is <blink>awesome</blink>.'); Chris@0: } Chris@0: } Chris@0: Chris@0: }