1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

Linter fix

This commit is contained in:
Matej Bačo 2022-08-16 13:03:38 +00:00
parent 3088535806
commit 2814a6f680
3 changed files with 9 additions and 8 deletions

View file

@ -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'],

View file

@ -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',

View file

@ -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']);