Linter fix
This commit is contained in:
parent
3088535806
commit
2814a6f680
|
@ -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
|
$hashOptionsObject = (\is_string($hashOptions)) ? \json_decode($hashOptions, true) : $hashOptions; // Cast to JSON array
|
||||||
|
|
||||||
if(!empty($email)) {
|
if (!empty($email)) {
|
||||||
$email = \strtolower($email);
|
$email = \strtolower($email);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$userId = $userId == 'unique()' ? $dbForProject->getId() : $userId;
|
$userId = $userId == 'unique()' ? $dbForProject->getId() : $userId;
|
||||||
|
|
||||||
$user = $dbForProject->createDocument('users', new Document([
|
$user = $dbForProject->createDocument('users', new Document([
|
||||||
'$id' => $userId,
|
'$id' => $userId,
|
||||||
'$read' => ['role:all'],
|
'$read' => ['role:all'],
|
||||||
|
|
|
@ -50,7 +50,7 @@ trait AccountBase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals($response['headers']['status-code'], 409);
|
$this->assertEquals($response['headers']['status-code'], 409);
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_POST, '/account', array_merge([
|
$response = $this->client->call(Client::METHOD_POST, '/account', array_merge([
|
||||||
'origin' => 'http://localhost',
|
'origin' => 'http://localhost',
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
|
|
|
@ -269,7 +269,8 @@ trait UsersBase
|
||||||
*
|
*
|
||||||
* @depends testCreateUser
|
* @depends testCreateUser
|
||||||
*/
|
*/
|
||||||
public function testCreateUserTypes(array $data): void {
|
public function testCreateUserTypes(array $data): void
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* Test for SUCCESS
|
* Test for SUCCESS
|
||||||
*/
|
*/
|
||||||
|
@ -308,7 +309,7 @@ trait UsersBase
|
||||||
], $this->getHeaders()), [
|
], $this->getHeaders()), [
|
||||||
'userId' => 'unique()',
|
'userId' => 'unique()',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEmpty($response['body']['email']);
|
$this->assertEmpty($response['body']['email']);
|
||||||
$this->assertEmpty($response['body']['password']);
|
$this->assertEmpty($response['body']['password']);
|
||||||
$this->assertEmpty($response['body']['phone']);
|
$this->assertEmpty($response['body']['phone']);
|
||||||
|
@ -321,7 +322,7 @@ trait UsersBase
|
||||||
'userId' => 'unique()',
|
'userId' => 'unique()',
|
||||||
'email' => 'emailonlyuser@appwrite.io',
|
'email' => 'emailonlyuser@appwrite.io',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertNotEmpty($response['body']['email']);
|
$this->assertNotEmpty($response['body']['email']);
|
||||||
$this->assertEmpty($response['body']['password']);
|
$this->assertEmpty($response['body']['password']);
|
||||||
$this->assertEmpty($response['body']['phone']);
|
$this->assertEmpty($response['body']['phone']);
|
||||||
|
@ -334,7 +335,7 @@ trait UsersBase
|
||||||
'userId' => 'unique()',
|
'userId' => 'unique()',
|
||||||
'password' => 'passwordOnlyUser',
|
'password' => 'passwordOnlyUser',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEmpty($response['body']['email']);
|
$this->assertEmpty($response['body']['email']);
|
||||||
$this->assertNotEmpty($response['body']['password']);
|
$this->assertNotEmpty($response['body']['password']);
|
||||||
$this->assertEmpty($response['body']['phone']);
|
$this->assertEmpty($response['body']['phone']);
|
||||||
|
@ -348,7 +349,7 @@ trait UsersBase
|
||||||
'password' => 'passwordOnlyUser',
|
'password' => 'passwordOnlyUser',
|
||||||
'phone' => '+123456789013',
|
'phone' => '+123456789013',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEmpty($response['body']['email']);
|
$this->assertEmpty($response['body']['email']);
|
||||||
$this->assertNotEmpty($response['body']['password']);
|
$this->assertNotEmpty($response['body']['password']);
|
||||||
$this->assertNotEmpty($response['body']['phone']);
|
$this->assertNotEmpty($response['body']['phone']);
|
||||||
|
|
Loading…
Reference in a new issue