diff --git a/core/modules/menu_ui/tests/src/Functional/MenuTest.php b/core/modules/menu_ui/tests/src/Functional/MenuTest.php index 308eb67b69..c40e4710d2 100644 --- a/core/modules/menu_ui/tests/src/Functional/MenuTest.php +++ b/core/modules/menu_ui/tests/src/Functional/MenuTest.php @@ -578,9 +578,16 @@ public function testBlockContextualLinks() { // Get server-rendered contextual links. // @see \Drupal\contextual\Tests\ContextualDynamicContextTest:renderContextualLinks() $post = ['ids[0]' => $id]; - $response = $this->drupalPost('contextual/render', 'application/json', $post, ['query' => ['destination' => 'test-page']]); - $this->assertResponse(200); - $json = Json::decode($response); + $client = \Drupal::httpClient(); + $url = $this->buildUrl('contextual/render', ['query' => ['destination' => 'test-page']]); + $response = $client->post($url, [ + 'form_params' => $post, + 'headers' => [ + 'Accept' => 'application/json', + ], + ]); + $this->assertEquals(200, $response->getStatusCode()); + $json = Json::decode((string) $response); $this->assertIdentical($json[$id], ''); }