Skip to content

Commit

Permalink
Add unique email test
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed May 1, 2024
1 parent b2e956a commit 0112fd9
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion tests/e2e/Services/Projects/ProjectsConsoleClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3929,6 +3929,31 @@ public function testTenantIsolation(): void
'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']);
}
}

0 comments on commit 0112fd9

Please sign in to comment.