diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 57a9d9699e..040d7da3d1 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; }