1
0
Fork 0
mirror of synced 2024-06-26 10:10:57 +12:00

Tests fixed, I hope

This commit is contained in:
Matej Baco 2021-12-20 16:56:58 +01:00
parent 27a43beddc
commit 5757a853f5

View file

@ -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;
}