From 2814a6f680a760a699a97f9cf130685c5eac0739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 16 Aug 2022 13:03:38 +0000 Subject: [PATCH] Linter fix --- app/controllers/api/users.php | 4 ++-- tests/e2e/Services/Account/AccountBase.php | 2 +- tests/e2e/Services/Users/UsersBase.php | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 9ec96bccd6..d416f72e01 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -35,13 +35,13 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e { $hashOptionsObject = (\is_string($hashOptions)) ? \json_decode($hashOptions, true) : $hashOptions; // Cast to JSON array - if(!empty($email)) { + if (!empty($email)) { $email = \strtolower($email); } try { $userId = $userId == 'unique()' ? $dbForProject->getId() : $userId; - + $user = $dbForProject->createDocument('users', new Document([ '$id' => $userId, '$read' => ['role:all'], diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 508a96f771..283c76a34b 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -50,7 +50,7 @@ trait AccountBase ]); $this->assertEquals($response['headers']['status-code'], 409); - + $response = $this->client->call(Client::METHOD_POST, '/account', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Users/UsersBase.php b/tests/e2e/Services/Users/UsersBase.php index 90c65e1306..1ea4621d75 100644 --- a/tests/e2e/Services/Users/UsersBase.php +++ b/tests/e2e/Services/Users/UsersBase.php @@ -269,7 +269,8 @@ trait UsersBase * * @depends testCreateUser */ - public function testCreateUserTypes(array $data): void { + public function testCreateUserTypes(array $data): void + { /** * Test for SUCCESS */ @@ -308,7 +309,7 @@ trait UsersBase ], $this->getHeaders()), [ 'userId' => 'unique()', ]); - + $this->assertEmpty($response['body']['email']); $this->assertEmpty($response['body']['password']); $this->assertEmpty($response['body']['phone']); @@ -321,7 +322,7 @@ trait UsersBase 'userId' => 'unique()', 'email' => 'emailonlyuser@appwrite.io', ]); - + $this->assertNotEmpty($response['body']['email']); $this->assertEmpty($response['body']['password']); $this->assertEmpty($response['body']['phone']); @@ -334,7 +335,7 @@ trait UsersBase 'userId' => 'unique()', 'password' => 'passwordOnlyUser', ]); - + $this->assertEmpty($response['body']['email']); $this->assertNotEmpty($response['body']['password']); $this->assertEmpty($response['body']['phone']); @@ -348,7 +349,7 @@ trait UsersBase 'password' => 'passwordOnlyUser', 'phone' => '+123456789013', ]); - + $this->assertEmpty($response['body']['email']); $this->assertNotEmpty($response['body']['password']); $this->assertNotEmpty($response['body']['phone']);