1
0
Fork 0
mirror of synced 2024-10-03 10:46:27 +13:00

Add unique email test

This commit is contained in:
Jake Barnby 2024-05-01 16:17:02 +12:00
parent b2e956a14d
commit 0112fd9b84
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -3929,6 +3929,31 @@ class ProjectsConsoleClientTest extends Scope
'name' => 'Amazing Collection',
]);
$this->assertEquals(201, $collection5['headers']['status-code']);
// Assert that users across projects on shared tables can have the same email as they're unique on tenant + email not just email
$user1 = $this->client->call(Client::METHOD_POST, '/users', [
'content-type' => 'application/json',
'x-appwrite-project' => $project2['body']['$id'],
'x-appwrite-key' => $key1['body']['secret']
], [
'userId' => 'user',
'email' => 'test@localhost',
'password' => 'password',
'name' => 'Test User',
]);
$this->assertEquals(201, $user1['headers']['status-code']);
$user2 = $this->client->call(Client::METHOD_POST, '/users', [
'content-type' => 'application/json',
'x-appwrite-project' => $project4['body']['$id'],
'x-appwrite-key' => $key2['body']['secret']
], [
'userId' => 'user',
'email' => 'test@localhost',
'password' => 'password',
'name' => 'Test User',
]);
$this->assertEquals(201, $user2['headers']['status-code']);
}
}