reverted: --- b/core/modules/system/tests/modules/test_page_test/src/Controller/Test.php +++ a/core/modules/system/tests/modules/test_page_test/src/Controller/Test.php @@ -1,7 +1,6 @@ 'foo|bar|baz']; } - /** - * Renders some simple json. - * - * @return \Symfony\Component\HttpFoundation\JsonResponse - * A json response. - */ - public function renderJson() { - return new JsonResponse(['some' => 'data']); - } - } reverted: --- b/core/modules/system/tests/modules/test_page_test/test_page_test.routing.yml +++ a/core/modules/system/tests/modules/test_page_test/test_page_test.routing.yml @@ -82,11 +82,3 @@ _form: '\Drupal\test_page_test\Form\TestForm' requirements: _access: 'TRUE' - -test_page_test.json: - path: '/test-json' - defaults: - _title: 'Simple json output' - _controller: '\Drupal\test_page_test\Controller\Test::renderJson' - requirements: - _access: 'TRUE' diff -u b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php --- b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php @@ -146,6 +146,9 @@ $sanitized = Html::escape($dangerous); $this->assertNoText($dangerous); $this->assertText($sanitized); + + // Test getRawContent(). + $this->assertSame($this->getSession()->getPage()->getContent(), $this->getRawContent()); } /** @@ -234,10 +237,2 @@ - /** - * Tests the getRawContent() method. - */ - public function testRawContent() { - $this->drupalGet('test-json'); - $this->assertEquals('{"some":"data"}', $this->getRawContent()); - } - }