Tests fixed, I hope
This commit is contained in:
parent
27a43beddc
commit
5757a853f5
1 changed files with 11 additions and 6 deletions
|
@ -756,12 +756,17 @@ trait AccountBase
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$prefsObject = [];
|
$prefsObject = [];
|
||||||
// Add 1024 keys
|
|
||||||
for($i = 1000; $i < 2024; $i++) {
|
$text1Kb = "";
|
||||||
$prefsObject["key" . $i] = "HelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHel";
|
for($i = 0; $i < 1024; $i++) {
|
||||||
// Each key is 7 characters and value is 63 characters
|
$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([
|
$response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([
|
||||||
'origin' => 'http://localhost',
|
'origin' => 'http://localhost',
|
||||||
|
@ -772,7 +777,7 @@ trait AccountBase
|
||||||
'prefs' => $prefsObject
|
'prefs' => $prefsObject
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals($response['headers']['status-code'], 400);
|
$this->assertEquals(400, $response['headers']['status-code']);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue