Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Form / EventSubscriber / FormAjaxSubscriberTest.php
index 278ec064166826dd4ab7f146057ffd4b2a93d9a0..aa69ad0f0b448158ff76f70af2409a3da62a69b5 100644 (file)
@@ -76,7 +76,8 @@ class FormAjaxSubscriberTest extends UnitTestCase {
       ->willReturn($response);
 
     $event = $this->assertResponseFromException($request, $exception, $response);
-    $this->assertSame(200, $event->getResponse()->headers->get('X-Status-Code'));
+    $this->assertTrue($event->isAllowingCustomResponseCode());
+    $this->assertSame(200, $event->getResponse()->getStatusCode());
   }
 
   /**
@@ -100,7 +101,8 @@ class FormAjaxSubscriberTest extends UnitTestCase {
       ->willReturn($response);
 
     $event = $this->assertResponseFromException($request, $exception, $response);
-    $this->assertSame(200, $event->getResponse()->headers->get('X-Status-Code'));
+    $this->assertTrue($event->isAllowingCustomResponseCode());
+    $this->assertSame(200, $event->getResponse()->getStatusCode());
   }
 
   /**
@@ -176,9 +178,10 @@ class FormAjaxSubscriberTest extends UnitTestCase {
 
     $event = new GetResponseForExceptionEvent($this->httpKernel, $request, HttpKernelInterface::MASTER_REQUEST, $exception);
     $this->subscriber->onException($event);
+    $this->assertTrue($event->isAllowingCustomResponseCode());
     $actual_response = $event->getResponse();
     $this->assertInstanceOf('\Drupal\Core\Ajax\AjaxResponse', $actual_response);
-    $this->assertSame(200, $actual_response->headers->get('X-Status-Code'));
+    $this->assertSame(200, $actual_response->getStatusCode());
     $expected_commands[] = [
       'command' => 'insert',
       'method' => 'prepend',