mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: Fix testUpdateAccountNameSearch for parallel execution
Use assertGreaterThanOrEqual and find user by ID instead of assuming position Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
a2ae55dcbe
commit
40ed0da8b3
@@ -2980,8 +2980,18 @@ class AccountCustomClientTest extends Scope
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body']);
|
||||
$this->assertNotEmpty($response['body']['users']);
|
||||
$this->assertCount(2, $response['body']['users']);
|
||||
$this->assertEquals($newName, $response['body']['users'][1]['name']);
|
||||
// In parallel execution, there may be more users with name 'Lorem'
|
||||
$this->assertGreaterThanOrEqual(1, count($response['body']['users']));
|
||||
// Find our user in the results
|
||||
$foundUser = null;
|
||||
foreach ($response['body']['users'] as $user) {
|
||||
if ($user['$id'] === $id) {
|
||||
$foundUser = $user;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->assertNotNull($foundUser, 'User should be found in search results');
|
||||
$this->assertEquals($newName, $foundUser['name']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/users', [
|
||||
'content-type' => 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user