From 972ce959b6278f65db69a2e91a551623d1148f2e Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 4 Jan 2022 16:48:15 +0100 Subject: [PATCH] fix: tests --- phpunit.xml | 2 +- tests/e2e/Services/Account/AccountBase.php | 23 +++------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 2fbb75e22..ceba1dcbf 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" + stopOnFailure="true" > diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 8fe3610cf..fcb9e8c8f 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -756,18 +756,7 @@ trait AccountBase * Prefs size exceeded */ - $prefsObject = []; - - $text1Kb = ""; - for($i = 0; $i < 1024; $i++) { - $text1Kb .= "🍰"; - } - - // Add 100 keys, each is 1kB - for($i = 0; $i < 100; $i++) { - $prefsObject["k" . $i] = $text1Kb; - } - // That makes total size minimum of 100kB, plus key size, plus any JSON syntax stuff. Max supported is 64kB, so this should exceed. + $prefsObject = ["longValue" => str_repeat("🍰", 100000)]; $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost', @@ -781,14 +770,8 @@ trait AccountBase $this->assertEquals(400, $response['headers']['status-code']); // Now let's test the same thing, but with normal symbol instead of multi-byte cake emoji - $prefsObject = []; - $text1Kb = ""; - for($i = 0; $i < 1024; $i++) { - $text1Kb .= "A"; - } - for($i = 0; $i < 100; $i++) { - $prefsObject["key" . $i] = $text1Kb; - } + $prefsObject = ["longValue" => str_repeat("-", 100000)]; + $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost',