From 5757a853f5798fe1828eb6c551b64d07f650333a Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Mon, 20 Dec 2021 16:56:58 +0100 Subject: [PATCH] Tests fixed, I hope --- tests/e2e/Services/Account/AccountBase.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 57a9d9699..040d7da3d 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -756,12 +756,17 @@ trait AccountBase */ $prefsObject = []; - // Add 1024 keys - for($i = 1000; $i < 2024; $i++) { - $prefsObject["key" . $i] = "HelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHel"; - // Each key is 7 characters and value is 63 characters + + $text1Kb = ""; + for($i = 0; $i < 1024; $i++) { + $text1Kb .= "🍰"; } - // That makes total size minimum of 70kB, plus any JSON stuff. Max supported is 64kB, so this should exceed. + + // Add 100 keys, each is 1kB + for($i = 0; $i < 100; $i++) { + $prefsObject["key" . $i] = $text1Kb; + } + // That makes total size minimum of 100kB, plus any JSON stuff. Max supported is 64kB, so this should exceed. $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost', @@ -772,7 +777,7 @@ trait AccountBase 'prefs' => $prefsObject ]); - $this->assertEquals($response['headers']['status-code'], 400); + $this->assertEquals(400, $response['headers']['status-code']); return $data; }