From f9b6325788ec2282d3f196eeec24e9f03f747fa5 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 14 Oct 2020 22:39:10 +0300 Subject: [PATCH] Fixed tests --- app/config/locale/translations/bg.countries.php | 2 +- tests/e2e/Client.php | 2 +- tests/e2e/Services/Locale/LocaleBase.php | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/config/locale/translations/bg.countries.php b/app/config/locale/translations/bg.countries.php index 5ba9b7a139..f6ae739ca3 100644 --- a/app/config/locale/translations/bg.countries.php +++ b/app/config/locale/translations/bg.countries.php @@ -34,7 +34,7 @@ return [ 'CH' => 'Швейцария', 'CL' => 'Чили', 'CN' => 'Китай', - 'CI' => `Кот д'Ивоар`, + 'CI' => 'Кот д\'Ивоар', 'CM' => 'Камерун', 'CD' => 'ДР Конго', 'CG' => 'Република Конго', diff --git a/tests/e2e/Client.php b/tests/e2e/Client.php index 5a84716b52..e72733e8fc 100644 --- a/tests/e2e/Client.php +++ b/tests/e2e/Client.php @@ -236,7 +236,7 @@ class Client $responseHeaders['status-code'] = $responseStatus; if($responseStatus === 500) { - echo 'Server error(!): '.json_encode($responseBody)."\n"; + echo 'Server error('.$method.': '.$path.'. Params: '.json_encode($params).'): '.json_encode($responseBody)."\n"; } return [ diff --git a/tests/e2e/Services/Locale/LocaleBase.php b/tests/e2e/Services/Locale/LocaleBase.php index 299d65434d..cdfb0c726a 100644 --- a/tests/e2e/Services/Locale/LocaleBase.php +++ b/tests/e2e/Services/Locale/LocaleBase.php @@ -2,6 +2,7 @@ namespace Tests\E2E\Services\Locale; +use Exception; use Tests\E2E\Client; trait LocaleBase @@ -237,6 +238,10 @@ trait LocaleBase 'x-appwrite-locale' => $lang, ]); + if(!\is_array($response['body']['countries'])) { + throw new Exception('Failed to itterate locale: '.$lang); + } + foreach ($response['body']['countries'] as $i => $code) { $this->assertArrayHasKey($code['code'], $defaultCountries, $code['code'] . ' country should be removed from ' . $lang); }