Skip to content
Snippets Groups Projects
Commit 800b4e21 authored by Stefan Bürk's avatar Stefan Bürk Committed by Christian Kuhn
Browse files

[BUGFIX] Prepare changed json_response middleware

The json_response functional test extension will soon
avoid returning json encoded responses. This will make
the functional frontend test suite fully transparent
regarding responses.
This patch prepares a couple of frontend functional
tests towards this change.

Resolves: #96112
Releases: master, 11.5
Change-Id: I8116caf08e4b8b76ad5d23b49954d9cb78d1c4de
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72319


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 0590f746
Branches
Tags
No related merge requests found
......@@ -865,14 +865,13 @@ class SlugSiteRequestTest extends AbstractTestCase
$this->internalRequestContext
->withFrontendUserId($frontendUserId)
);
$json = json_decode((string)$response->getBody(), true);
self::assertSame(
403,
$response->getStatusCode()
);
self::assertThat(
$json['body'] ?? null,
(string)$response->getBody(),
self::logicalOr(
self::stringContains('That page is forbidden to you'),
self::stringContains('ID was not an accessible page'),
......@@ -1029,14 +1028,13 @@ class SlugSiteRequestTest extends AbstractTestCase
$this->internalRequestContext
->withFrontendUserId($frontendUserId)
);
$json = json_decode((string)$response->getBody(), true);
self::assertSame(
403,
$response->getStatusCode()
);
self::assertThat(
$json['body'] ?? null,
(string)$response->getBody(),
self::logicalOr(
self::stringContains('That page is forbidden to you'),
self::stringContains('ID was not an accessible page'),
......@@ -1226,13 +1224,13 @@ class SlugSiteRequestTest extends AbstractTestCase
new InternalRequest($uri),
$this->internalRequestContext
);
$json = json_decode((string)$response->getBody(), true);
self::assertSame(
404,
$response->getStatusCode()
);
self::assertThat(
$json['body'] ?? null,
(string)$response->getBody(),
self::stringContains('That page was not found')
);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment