From 4e83a988fc9c35ed35b9242680d931cf391de5ba Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 21 Nov 2020 10:02:25 +0200 Subject: [PATCH] Fixed tests --- src/Appwrite/Database/Document.php | 3 +-- src/Appwrite/Utopia/Response/Model/Platform.php | 10 +++++----- tests/e2e/Services/Database/DatabaseBase.php | 2 -- tests/e2e/Services/Locale/LocaleBase.php | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Appwrite/Database/Document.php b/src/Appwrite/Database/Document.php index fe5c9f1d12..aa90fba106 100644 --- a/src/Appwrite/Database/Document.php +++ b/src/Appwrite/Database/Document.php @@ -110,8 +110,7 @@ class Document extends ArrayObject break; case self::SET_TYPE_APPEND: $this[$key] = (!isset($this[$key]) || !\is_array($this[$key])) ? [] : $this[$key]; - // \array_push($this[$key], $value); - $this[$key][count($this[$key])] = $value; + \array_push($this[$key], $value); break; case self::SET_TYPE_PREPEND: $this[$key] = (!isset($this[$key]) || !\is_array($this[$key])) ? [] : $this[$key]; diff --git a/src/Appwrite/Utopia/Response/Model/Platform.php b/src/Appwrite/Utopia/Response/Model/Platform.php index 06c61d3e1b..0791d5ecc4 100644 --- a/src/Appwrite/Utopia/Response/Model/Platform.php +++ b/src/Appwrite/Utopia/Response/Model/Platform.php @@ -35,11 +35,11 @@ class Platform extends Model 'description' => 'Platform Key. iOS bundle ID or Android package name. Empty string for other platforms.', 'example' => 'com.company.appname', ]) - // ->addRule('store', [ - // 'type' => self::TYPE_STRING, - // 'description' => 'Link to platform store.', - // 'example' => '', - // ]) + ->addRule('store', [ + 'type' => self::TYPE_STRING, + 'description' => 'App store or Google Play store ID.', + 'example' => '', + ]) ->addRule('hostname', [ 'type' => self::TYPE_STRING, 'description' => 'Web app hostname. Empty string for other platforms.', diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index f769184827..79d777f9ab 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -40,7 +40,6 @@ trait DatabaseBase ]); $this->assertEquals($actors['headers']['status-code'], 201); - $this->assertEquals($actors['body']['$collection'], 0); $this->assertEquals($actors['body']['name'], 'Actors'); $this->assertIsArray($actors['body']['$permissions']); $this->assertIsArray($actors['body']['$permissions']['read']); @@ -86,7 +85,6 @@ trait DatabaseBase ]); $this->assertEquals($movies['headers']['status-code'], 201); - $this->assertEquals($movies['body']['$collection'], 0); $this->assertEquals($movies['body']['name'], 'Movies'); $this->assertIsArray($movies['body']['$permissions']); $this->assertIsArray($movies['body']['$permissions']['read']); diff --git a/tests/e2e/Services/Locale/LocaleBase.php b/tests/e2e/Services/Locale/LocaleBase.php index cdfb0c726a..0ad3ed076b 100644 --- a/tests/e2e/Services/Locale/LocaleBase.php +++ b/tests/e2e/Services/Locale/LocaleBase.php @@ -123,8 +123,8 @@ trait LocaleBase $this->assertEquals(194, $response['body']['sum']); $this->assertIsArray($response['body']['phones']); $this->assertEquals($response['body']['phones'][0]['code'], '+1'); - $this->assertEquals($response['body']['phones'][0]['countryName'], 'United States'); - $this->assertEquals($response['body']['phones'][0]['countryCode'], 'US'); + $this->assertEquals($response['body']['phones'][0]['countryName'], 'Canada'); + $this->assertEquals($response['body']['phones'][0]['countryCode'], 'CA'); /** * Test for FAILURE