diff --git a/tests/e2e/Services/Avatars/AvatarsBase.php b/tests/e2e/Services/Avatars/AvatarsBase.php index 614349ae74..06ee4687f7 100644 --- a/tests/e2e/Services/Avatars/AvatarsBase.php +++ b/tests/e2e/Services/Avatars/AvatarsBase.php @@ -351,9 +351,9 @@ trait AvatarsBase $image = new \Imagick(); $image->readImageBlob($response['body']); - $this->assertEquals(400, $image->getImageWidth()); - $this->assertEquals(400, $image->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame(400, $image->getImageWidth()); + $this->assertSame(400, $image->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); $this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-default.png', $response['body']); $response = $this->client->call(Client::METHOD_GET, '/avatars/qr', [ @@ -369,9 +369,9 @@ trait AvatarsBase $image = new \Imagick(); $image->readImageBlob($response['body']); - $this->assertEquals(200, $image->getImageWidth()); - $this->assertEquals(200, $image->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame(200, $image->getImageWidth()); + $this->assertSame(200, $image->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); $this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-size-200.png', $response['body']); $response = $this->client->call(Client::METHOD_GET, '/avatars/qr', [ @@ -388,9 +388,9 @@ trait AvatarsBase $image = new \Imagick(); $image->readImageBlob($response['body']); - $this->assertEquals(200, $image->getImageWidth()); - $this->assertEquals(200, $image->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame(200, $image->getImageWidth()); + $this->assertSame(200, $image->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); $this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-size-200-margin-10.png', $response['body']); $response = $this->client->call(Client::METHOD_GET, '/avatars/qr', [ @@ -404,9 +404,9 @@ trait AvatarsBase $image = new \Imagick(); $image->readImageBlob($response['body']); - $this->assertEquals(200, $image->getImageWidth()); - $this->assertEquals(200, $image->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame(200, $image->getImageWidth()); + $this->assertSame(200, $image->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); $this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-size-200-margin-10.png', $response['body']); $this->assertEquals(200, $response['headers']['status-code']); @@ -536,9 +536,9 @@ trait AvatarsBase $image->readImageBlob($response['body']); $original = new \Imagick(__DIR__ . '/../../../resources/initials.png'); - $this->assertEquals($image->getImageWidth(), $original->getImageWidth()); - $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame($image->getImageWidth(), $original->getImageWidth()); + $this->assertSame($image->getImageHeight(), $original->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); } public function testSpecialCharsInitalImage() @@ -559,9 +559,9 @@ trait AvatarsBase $image->readImageBlob($response['body']); $original = new \Imagick(__DIR__ . '/../../../resources/initials.png'); - $this->assertEquals($image->getImageWidth(), $original->getImageWidth()); - $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame($image->getImageWidth(), $original->getImageWidth()); + $this->assertSame($image->getImageHeight(), $original->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); } public function testGetScreenshot(): array diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index c1a2be42ba..5e31035fce 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -1242,7 +1242,7 @@ trait DatabasesBase ], ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, \count($response['body'][$this->getSchemaResource()])); + $this->assertSame(2, \count($response['body'][$this->getSchemaResource()])); $response = $this->client->call(Client::METHOD_GET, $this->getSchemaUrl($databaseId, $data['moviesId']), array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -2527,7 +2527,7 @@ trait DatabasesBase ], ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, \count($response['body']['indexes'])); + $this->assertSame(2, \count($response['body']['indexes'])); $response = $this->client->call(Client::METHOD_GET, $this->getIndexUrl($databaseId, $data['moviesId']), array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -6863,7 +6863,7 @@ trait DatabasesBase $this->assertEquals(201, $person2['headers']['status-code']); $this->assertArrayHasKey('libraries', $person2['body']); - $this->assertEquals(2, count($person2['body']['libraries'])); + $this->assertSame(2, count($person2['body']['libraries'])); $response = $this->client->call(Client::METHOD_GET, $this->getRecordUrl($databaseId, $personCollection, $person2['body']['$id']), array_merge([ 'content-type' => 'application/json', @@ -6877,7 +6877,7 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertArrayNotHasKey('$collection', $response['body']); $this->assertArrayHasKey('libraries', $response['body']); - $this->assertEquals(2, count($response['body']['libraries'])); + $this->assertSame(2, count($response['body']['libraries'])); $response = $this->client->call(Client::METHOD_GET, $this->getRecordUrl($databaseId, $libraryCollection, $libraryDoc11Id), array_merge([ 'content-type' => 'application/json', @@ -7062,7 +7062,7 @@ trait DatabasesBase $this->assertEquals(200, $artist['headers']['status-code']); $this->assertEquals('Artist 1', $artist['body']['name']); $this->assertEquals($permissions, $artist['body']['$permissions']); - $this->assertEquals(1, count($artist['body']['albums'])); + $this->assertSame(1, count($artist['body']['albums'])); $this->assertEquals('album1', $artist['body']['albums'][0]['$id']); $this->assertEquals('Album 1', $artist['body']['albums'][0]['name']); $this->assertEquals($permissions, $artist['body']['albums'][0]['$permissions']); @@ -7222,7 +7222,7 @@ trait DatabasesBase $this->assertEquals(200, $player['headers']['status-code']); $this->assertEquals('Player 1', $player['body']['name']); $this->assertEquals($permissions, $player['body']['$permissions']); - $this->assertEquals(1, count($player['body']['sports'])); + $this->assertSame(1, count($player['body']['sports'])); $this->assertEquals('sport1', $player['body']['sports'][0]['$id']); $this->assertEquals('Sport 1', $player['body']['sports'][0]['name']); $this->assertEquals($permissions, $player['body']['sports'][0]['$permissions']); @@ -7251,10 +7251,10 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(1, count($response['body'][$this->getRecordResource()])); + $this->assertSame(1, count($response['body'][$this->getRecordResource()])); $this->assertNotEmpty($response['body'][$this->getRecordResource()][0]['$id']); $this->assertEquals('Stevie Wonder', $response['body'][$this->getRecordResource()][0]['fullName']); - $this->assertEquals(2, count($response['body'][$this->getRecordResource()][0]['libraries'])); + $this->assertSame(2, count($response['body'][$this->getRecordResource()][0]['libraries'])); $response = $this->client->call(Client::METHOD_GET, $this->getRecordUrl($data['databaseId'], $data['personCollection']), array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Databases/Transactions/TransactionsBase.php b/tests/e2e/Services/Databases/Transactions/TransactionsBase.php index cbf0303438..5060c4c319 100644 --- a/tests/e2e/Services/Databases/Transactions/TransactionsBase.php +++ b/tests/e2e/Services/Databases/Transactions/TransactionsBase.php @@ -1223,9 +1223,9 @@ trait TransactionsBase } } - $this->assertEquals(0, $oldCategoryCount); - $this->assertEquals(4, $updatedCategoryCount); // 4 existing docs updated - $this->assertEquals(3, $newCategoryCount); // 3 new docs + $this->assertSame(0, $oldCategoryCount); + $this->assertSame(4, $updatedCategoryCount); // 4 existing docs updated + $this->assertSame(3, $newCategoryCount); // 3 new docs } /** diff --git a/tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php b/tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php index 1bdc77085b..ee50524176 100644 --- a/tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php @@ -187,7 +187,7 @@ trait DatabasesBase ] ]); $this->assertEquals(200, $page1['headers']['status-code']); - $this->assertEquals(1, \count($page1['body']['documents'] ?? [])); + $this->assertSame(1, \count($page1['body']['documents'] ?? [])); $page2 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', @@ -201,7 +201,7 @@ trait DatabasesBase ] ]); $this->assertEquals(200, $page2['headers']['status-code']); - $this->assertEquals(1, \count($page2['body']['documents'] ?? [])); + $this->assertSame(1, \count($page2['body']['documents'] ?? [])); return $data; } diff --git a/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsBase.php b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsBase.php index 70150a3bc8..b8cc9f6f0d 100644 --- a/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsBase.php +++ b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsBase.php @@ -1050,9 +1050,9 @@ trait TransactionsBase } } - $this->assertEquals(0, $oldCategoryCount); - $this->assertEquals(4, $updatedCategoryCount); // 4 existing docs updated - $this->assertEquals(3, $newCategoryCount); // 3 new docs + $this->assertSame(0, $oldCategoryCount); + $this->assertSame(4, $updatedCategoryCount); // 4 existing docs updated + $this->assertSame(3, $newCategoryCount); // 3 new docs } /** diff --git a/tests/e2e/Services/GraphQL/Base.php b/tests/e2e/Services/GraphQL/Base.php index b9a2c3eb16..09d978fab4 100644 --- a/tests/e2e/Services/GraphQL/Base.php +++ b/tests/e2e/Services/GraphQL/Base.php @@ -514,8 +514,8 @@ trait Base $this->assertNotEmpty($image->output('png')); $this->assertIsArray($dimensions); - $this->assertEquals(100, $dimensions[0]); - $this->assertEquals(100, $dimensions[1]); + $this->assertSame(100, $dimensions[0]); + $this->assertSame(100, $dimensions[1]); } public function getQuery(string $name): string diff --git a/tests/e2e/Services/Messaging/MessagingBase.php b/tests/e2e/Services/Messaging/MessagingBase.php index 6b4d7e9466..dbf2e34aa1 100644 --- a/tests/e2e/Services/Messaging/MessagingBase.php +++ b/tests/e2e/Services/Messaging/MessagingBase.php @@ -1160,7 +1160,7 @@ trait MessagingBase ]); $this->assertEquals(201, $response2['headers']['status-code']); $this->assertEquals('my-app2', $response2['body']['name']); - $this->assertEquals(1, \count($response2['body']['subscribe'])); + $this->assertSame(1, \count($response2['body']['subscribe'])); } public function testUpdateTopic(): void @@ -1221,7 +1221,7 @@ trait MessagingBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(0, \count($response['body']['topics'])); + $this->assertSame(0, \count($response['body']['topics'])); return $topicId; } @@ -1571,7 +1571,7 @@ trait MessagingBase $targetList = $response['body']; $this->assertEquals(2, $targetList['total']); - $this->assertEquals(2, count($targetList['targets'])); + $this->assertSame(2, count($targetList['targets'])); $this->assertEquals($message['targets'][0], $targetList['targets'][0]['$id']); $this->assertEquals($message['targets'][1], $targetList['targets'][1]['$id']); @@ -1588,7 +1588,7 @@ trait MessagingBase ] ]); $this->assertEquals(2, $response['body']['total']); - $this->assertEquals(1, count($response['body']['targets'])); + $this->assertSame(1, count($response['body']['targets'])); $this->assertEquals($targetList['targets'][1]['$id'], $response['body']['targets'][0]['$id']); // Test for empty targets @@ -1617,7 +1617,7 @@ trait MessagingBase $targetList = $response['body']; $this->assertEquals(0, $targetList['total']); - $this->assertEquals(0, count($targetList['targets'])); + $this->assertSame(0, count($targetList['targets'])); } public function testCreateDraftEmail(): void @@ -1638,7 +1638,7 @@ trait MessagingBase $user1 = $response['body']; - $this->assertEquals(1, \count($user1['targets'])); + $this->assertSame(1, \count($user1['targets'])); $targetId1 = $user1['targets'][0]['$id']; // Create User 2 @@ -1656,7 +1656,7 @@ trait MessagingBase $this->assertEquals(201, $response['headers']['status-code'], "Error creating user: " . var_export($response['body'], true)); $user2 = $response['body']; - $this->assertEquals(1, \count($user2['targets'])); + $this->assertSame(1, \count($user2['targets'])); $targetId2 = $user2['targets'][0]['$id']; // Create Email @@ -1692,7 +1692,7 @@ trait MessagingBase ]); $this->assertEquals(201, $user['headers']['status-code'], "Error creating user: " . var_export($user['body'], true)); - $this->assertEquals(1, \count($user['body']['targets'])); + $this->assertSame(1, \count($user['body']['targets'])); // Create push target $target = $this->client->call(Client::METHOD_POST, '/users/' . $user['body']['$id'] . '/targets', [ @@ -1939,7 +1939,7 @@ trait MessagingBase $this->assertEquals(200, $message['headers']['status-code']); $this->assertEquals(MessageStatus::SCHEDULED, $message['body']['status']); - $this->assertEquals( + $this->assertSame( (new \DateTime($scheduledAt))->getTimestamp(), (new \DateTime($message['body']['scheduledAt']))->getTimestamp() ); @@ -1990,7 +1990,7 @@ trait MessagingBase $this->assertEquals(200, $message['headers']['status-code']); $this->assertEquals(MessageStatus::SCHEDULED, $message['body']['status']); - $this->assertEquals( + $this->assertSame( (new \DateTime($scheduledAt))->getTimestamp(), (new \DateTime($message['body']['scheduledAt']))->getTimestamp() ); @@ -2007,7 +2007,7 @@ trait MessagingBase ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(MessageStatus::SCHEDULED, $response['body']['status']); - $this->assertEquals( + $this->assertSame( (new \DateTime($scheduledAt))->getTimestamp(), (new \DateTime($response['body']['scheduledAt']))->getTimestamp() ); @@ -2119,7 +2119,7 @@ trait MessagingBase $this->assertEquals(200, $message['headers']['status-code']); $this->assertEquals(1, $message['body']['deliveredTotal']); - $this->assertEquals(0, \count($message['body']['deliveryErrors'])); + $this->assertSame(0, \count($message['body']['deliveryErrors'])); return [ 'message' => $email['body'], @@ -2190,7 +2190,7 @@ trait MessagingBase $this->assertEquals(200, $message['headers']['status-code']); $this->assertEquals(1, $message['body']['deliveredTotal']); - $this->assertEquals(0, \count($message['body']['deliveryErrors'])); + $this->assertSame(0, \count($message['body']['deliveryErrors'])); } public function testSendSMS(): void @@ -2308,7 +2308,7 @@ trait MessagingBase $this->assertEquals(200, $message['headers']['status-code']); $this->assertEquals(1, $message['body']['deliveredTotal']); - $this->assertEquals(0, \count($message['body']['deliveryErrors'])); + $this->assertSame(0, \count($message['body']['deliveryErrors'])); } public function testUpdateSMS(): void @@ -2371,7 +2371,7 @@ trait MessagingBase $this->assertEquals(200, $message['headers']['status-code']); $this->assertEquals(1, $message['body']['deliveredTotal']); - $this->assertEquals(0, \count($message['body']['deliveryErrors'])); + $this->assertSame(0, \count($message['body']['deliveryErrors'])); } public function testSendPushNotification(): void @@ -2486,7 +2486,7 @@ trait MessagingBase $this->assertEquals(200, $message['headers']['status-code']); $this->assertEquals(1, $message['body']['deliveredTotal']); - $this->assertEquals(0, \count($message['body']['deliveryErrors'])); + $this->assertSame(0, \count($message['body']['deliveryErrors'])); } public function testCreatePushNotificationWithUsersRecipients(): void @@ -2663,7 +2663,7 @@ trait MessagingBase $this->assertEquals(200, $message['headers']['status-code']); $this->assertEquals(1, $message['body']['deliveredTotal']); - $this->assertEquals(0, \count($message['body']['deliveryErrors'])); + $this->assertSame(0, \count($message['body']['deliveryErrors'])); } /** diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index 051729cc98..53fce889a6 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -4926,7 +4926,7 @@ trait MigrationsBase $this->assertEquals(201, $user['headers']['status-code']); $userId = $user['body']['$id']; - $this->assertEquals(1, \count($user['body']['targets'])); + $this->assertSame(1, \count($user['body']['targets'])); $targetId = $user['body']['targets'][0]['$id']; $provider = $this->client->call(Client::METHOD_POST, '/messaging/providers/sendgrid', [ @@ -5050,7 +5050,7 @@ trait MigrationsBase $this->assertEquals(201, $user['headers']['status-code']); $userId = $user['body']['$id']; - $this->assertEquals(1, \count($user['body']['targets'])); + $this->assertSame(1, \count($user['body']['targets'])); $targetId = $user['body']['targets'][0]['$id']; $provider = $this->client->call(Client::METHOD_POST, '/messaging/providers/sendgrid', [ @@ -5433,7 +5433,7 @@ trait MigrationsBase $this->assertEquals($messageId, $response['body']['$id']); $this->assertEquals('scheduled', $response['body']['status']); $this->assertEquals('Migration Scheduled Email', $response['body']['data']['subject']); - $this->assertEquals( + $this->assertSame( (new \DateTime($futureDate))->getTimestamp(), (new \DateTime($response['body']['scheduledAt']))->getTimestamp(), ); diff --git a/tests/e2e/Services/ProjectWebhooks/WebhooksBase.php b/tests/e2e/Services/ProjectWebhooks/WebhooksBase.php index e852cf093b..b040cbfe1d 100644 --- a/tests/e2e/Services/ProjectWebhooks/WebhooksBase.php +++ b/tests/e2e/Services/ProjectWebhooks/WebhooksBase.php @@ -436,7 +436,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], 'Actors'); $this->assertIsArray($webhook['data']['$permissions']); @@ -617,7 +617,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['firstName'], 'Chris'); $this->assertEquals($webhook['data']['lastName'], 'Evans'); @@ -676,7 +676,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['firstName'], 'Chris1'); $this->assertEquals($webhook['data']['lastName'], 'Evans2'); @@ -743,7 +743,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['firstName'], 'Bradly'); $this->assertEquals($webhook['data']['lastName'], 'Cooper'); @@ -805,7 +805,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], 'Actors'); $this->assertIsArray($webhook['data']['$permissions']); @@ -984,7 +984,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['firstName'], 'Chris'); $this->assertEquals($webhook['data']['lastName'], 'Evans'); @@ -1043,7 +1043,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['firstName'], 'Chris1'); $this->assertEquals($webhook['data']['lastName'], 'Evans2'); @@ -1110,7 +1110,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['firstName'], 'Bradly'); $this->assertEquals($webhook['data']['lastName'], 'Cooper'); @@ -1156,7 +1156,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals('Test Bucket', $webhook['data']['name']); $this->assertEquals(true, $webhook['data']['enabled']); @@ -1198,7 +1198,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals('Test Bucket Updated', $webhook['data']['name']); $this->assertEquals(false, $webhook['data']['enabled']); @@ -1252,7 +1252,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertEquals($webhook['data']['name'], 'logo.png'); @@ -1306,7 +1306,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertEquals($webhook['data']['name'], 'logo.png'); @@ -1354,7 +1354,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertEquals($webhook['data']['name'], 'logo.png'); @@ -1406,7 +1406,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals('Test Bucket Updated', $webhook['data']['name']); $this->assertEquals(true, $webhook['data']['enabled']); @@ -1444,7 +1444,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals('Arsenal', $webhook['data']['name']); $this->assertGreaterThan(-1, $webhook['data']['total']); @@ -1483,7 +1483,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals('Demo New', $webhook['data']['name']); $this->assertGreaterThan(-1, $webhook['data']['total']); @@ -1528,7 +1528,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertEquals($webhook['data'], [ 'prefKey1' => 'prefValue1', 'prefKey2' => 'prefValue2', @@ -1571,7 +1571,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals('Chelsea', $webhook['data']['name']); $this->assertGreaterThan(-1, $webhook['data']['total']); @@ -1639,7 +1639,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['teamId']); @@ -1700,7 +1700,7 @@ trait WebhooksBase $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertSame(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['teamId']); diff --git a/tests/e2e/Services/Proxy/ProxyBase.php b/tests/e2e/Services/Proxy/ProxyBase.php index d0e4c0d793..1d5d97377c 100644 --- a/tests/e2e/Services/Proxy/ProxyBase.php +++ b/tests/e2e/Services/Proxy/ProxyBase.php @@ -35,7 +35,7 @@ trait ProxyBase ] ]); $this->assertEquals(200, $rules['headers']['status-code']); - $this->assertEquals(0, count($rules['body']['rules'])); + $this->assertSame(0, count($rules['body']['rules'])); $this->assertEquals(0, $rules['body']['total']); } } diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index 9455673468..caa62fed5b 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -741,7 +741,7 @@ trait StorageBase ], ]); $this->assertEquals(200, $files['headers']['status-code']); - $this->assertEquals(1, count($files['body']['files'])); + $this->assertSame(1, count($files['body']['files'])); $files = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $data['bucketId'] . '/files', array_merge([ 'content-type' => 'application/json', @@ -752,7 +752,7 @@ trait StorageBase ], ]); $this->assertEquals(200, $files['headers']['status-code']); - $this->assertEquals(1, count($files['body']['files'])); + $this->assertSame(1, count($files['body']['files'])); $files = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $data['bucketId'] . '/files', array_merge([ 'content-type' => 'application/json', @@ -763,7 +763,7 @@ trait StorageBase ], ]); $this->assertEquals(200, $files['headers']['status-code']); - $this->assertEquals(1, count($files['body']['files'])); + $this->assertSame(1, count($files['body']['files'])); $files = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $data['bucketId'] . '/files', array_merge([ 'content-type' => 'application/json', @@ -774,7 +774,7 @@ trait StorageBase ], ]); $this->assertEquals(200, $files['headers']['status-code']); - $this->assertEquals(0, count($files['body']['files'])); + $this->assertSame(0, count($files['body']['files'])); /** * Test for FAILURE unknown Bucket @@ -864,9 +864,9 @@ trait StorageBase $image->readImageBlob($file3['body']); $original = new \Imagick(__DIR__ . '/../../../resources/logo-after.png'); - $this->assertEquals($image->getImageWidth(), $original->getImageWidth()); - $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame($image->getImageWidth(), $original->getImageWidth()); + $this->assertSame($image->getImageHeight(), $original->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); $file4 = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $data['fileId'] . '/preview', array_merge([ 'content-type' => 'application/json', @@ -887,9 +887,9 @@ trait StorageBase $image->readImageBlob($file4['body']); $original = new \Imagick(__DIR__ . '/../../../resources/logo-after.jpg'); - $this->assertEquals($image->getImageWidth(), $original->getImageWidth()); - $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); - $this->assertEquals('JPEG', $image->getImageFormat()); + $this->assertSame($image->getImageWidth(), $original->getImageWidth()); + $this->assertSame($image->getImageHeight(), $original->getImageHeight()); + $this->assertSame('JPEG', $image->getImageFormat()); $file5 = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $data['fileId'] . '/download', array_merge([ 'content-type' => 'application/json', @@ -974,9 +974,9 @@ trait StorageBase $image->readImageBlob($file7['body']); $original = new \Imagick(__DIR__ . '/../../../resources/logo-after.png'); - $this->assertEquals($image->getImageWidth(), $original->getImageWidth()); - $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame($image->getImageWidth(), $original->getImageWidth()); + $this->assertSame($image->getImageHeight(), $original->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); /** * Test large files decompress successfully @@ -1131,7 +1131,7 @@ trait StorageBase $imageAfter = new \Imagick(); $imageAfter->readImageBlob($file3['body']); - $this->assertNotEquals($imageBefore->getImageBlob(), $imageAfter->getImageBlob()); + $this->assertNotSame($imageBefore->getImageBlob(), $imageAfter->getImageBlob()); } public function testFilePreviewCacheControlOnCacheHit(): void @@ -1874,7 +1874,7 @@ trait StorageBase ])); $this->assertEquals(200, $download['headers']['status-code']); - $this->assertEquals($totalSize, strlen($download['body'])); + $this->assertSame($totalSize, strlen($download['body'])); $this->assertEquals(hash_file('sha256', $source), hash('sha256', $download['body'])); } finally { if (isset($bucketId)) { diff --git a/tests/e2e/Services/Teams/TeamsBase.php b/tests/e2e/Services/Teams/TeamsBase.php index 9def4b6c48..7e8dc69a3e 100644 --- a/tests/e2e/Services/Teams/TeamsBase.php +++ b/tests/e2e/Services/Teams/TeamsBase.php @@ -225,7 +225,7 @@ trait TeamsBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, count($response['body']['teams'])); + $this->assertSame(2, count($response['body']['teams'])); $response = $this->client->call(Client::METHOD_GET, '/teams', array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Tokens/TokensBase.php b/tests/e2e/Services/Tokens/TokensBase.php index 1fcdeb347f..6b85241ef1 100644 --- a/tests/e2e/Services/Tokens/TokensBase.php +++ b/tests/e2e/Services/Tokens/TokensBase.php @@ -218,9 +218,9 @@ trait TokensBase $image->readImageBlob($filePreview['body']); $original = new \Imagick(__DIR__ . '/../../../resources/logo.png'); - $this->assertEquals($image->getImageWidth(), $original->getImageWidth()); - $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame($image->getImageWidth(), $original->getImageWidth()); + $this->assertSame($image->getImageHeight(), $original->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); } public function testCustomPreviewFileWithToken(): void @@ -255,9 +255,9 @@ trait TokensBase $image->readImageBlob($customFilePreview['body']); $original = new \Imagick(__DIR__ . '/../../../resources/logo-after.png'); - $this->assertEquals($image->getImageWidth(), $original->getImageWidth()); - $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame($image->getImageWidth(), $original->getImageWidth()); + $this->assertSame($image->getImageHeight(), $original->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); } public function testViewFileWithToken(): void @@ -283,9 +283,9 @@ trait TokensBase $image->readImageBlob($fileView['body']); $original = new \Imagick(__DIR__ . '/../../../resources/logo.png'); - $this->assertEquals($image->getImageWidth(), $original->getImageWidth()); - $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame($image->getImageWidth(), $original->getImageWidth()); + $this->assertSame($image->getImageHeight(), $original->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); } public function testDownloadFileWithToken(): void @@ -311,9 +311,9 @@ trait TokensBase $image->readImageBlob($fileDownload['body']); $original = new \Imagick(__DIR__ . '/../../../resources/logo.png'); - $this->assertEquals($image->getImageWidth(), $original->getImageWidth()); - $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame($image->getImageWidth(), $original->getImageWidth()); + $this->assertSame($image->getImageHeight(), $original->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); } public function testFileAccessWithFileSecurity(): void @@ -392,9 +392,9 @@ trait TokensBase $image->readImageBlob($response['body']); $original = new \Imagick(__DIR__ . '/../../../resources/logo.png'); - $this->assertEquals($original->getImageWidth(), $image->getImageWidth()); - $this->assertEquals($original->getImageHeight(), $image->getImageHeight()); - $this->assertEquals('PNG', $image->getImageFormat()); + $this->assertSame($original->getImageWidth(), $image->getImageWidth()); + $this->assertSame($original->getImageHeight(), $image->getImageHeight()); + $this->assertSame('PNG', $image->getImageFormat()); } } diff --git a/tests/e2e/Services/Users/UsersBase.php b/tests/e2e/Services/Users/UsersBase.php index 57baf4b6f2..be39b35cae 100644 --- a/tests/e2e/Services/Users/UsersBase.php +++ b/tests/e2e/Services/Users/UsersBase.php @@ -327,7 +327,7 @@ trait UsersBase // Test empty prefs is object not array $bodyString = $user['body']; $prefs = substr($bodyString, strpos($bodyString, '"prefs":') + 8, 2); - $this->assertEquals('{}', $prefs); + $this->assertSame('{}', $prefs); $body = json_decode($bodyString, true); @@ -562,7 +562,7 @@ trait UsersBase $this->assertEquals(201, $token['headers']['status-code']); $this->assertEquals($data['userId'], $token['body']['userId']); - $this->assertEquals(15, strlen($token['body']['secret'])); + $this->assertSame(15, strlen($token['body']['secret'])); $this->assertNotEmpty($token['body']['expire']); /** diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index f926a97c81..6e4bd6dc37 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -39,7 +39,7 @@ trait WebhooksBase $this->assertEquals('', $webhook['body']['authUsername']); $this->assertEquals('', $webhook['body']['authPassword']); $this->assertNotEmpty($webhook['body']['secret']); - $this->assertEquals(128, \strlen($webhook['body']['secret'])); + $this->assertSame(128, \strlen($webhook['body']['secret'])); $this->assertEquals(0, $webhook['body']['attempts']); $this->assertEquals('', $webhook['body']['logs']); @@ -683,7 +683,7 @@ trait WebhooksBase $originalSecret = $webhook['body']['secret']; $this->assertNotEmpty($originalSecret); - $this->assertEquals(128, \strlen($originalSecret)); + $this->assertSame(128, \strlen($originalSecret)); // Update secret $updated = $this->updateWebhookSecret($webhookId); @@ -691,7 +691,7 @@ trait WebhooksBase $this->assertEquals(200, $updated['headers']['status-code']); $this->assertEquals($webhookId, $updated['body']['$id']); $this->assertNotEmpty($updated['body']['secret']); - $this->assertEquals(128, \strlen($updated['body']['secret'])); + $this->assertSame(128, \strlen($updated['body']['secret'])); $this->assertNotEquals($originalSecret, $updated['body']['secret']); // Verify secret is not exposed via GET @@ -726,7 +726,7 @@ trait WebhooksBase $webhookId = $webhook['body']['$id']; $originalSecret = $webhook['body']['secret']; $this->assertNotEmpty($originalSecret); - $this->assertEquals(128, \strlen($originalSecret)); + $this->assertSame(128, \strlen($originalSecret)); // Step 1: Trigger user creation with the original auto-generated secret $email1 = uniqid() . 'rotation1@localhost.test'; @@ -1908,7 +1908,7 @@ trait WebhooksBase $this->assertEquals('olduser', $webhook['body']['httpUser']); $this->assertEquals('oldpass', $webhook['body']['httpPass']); $this->assertNotEmpty($webhook['body']['signatureKey']); - $this->assertEquals(128, \strlen($webhook['body']['signatureKey'])); + $this->assertSame(128, \strlen($webhook['body']['signatureKey'])); // Cleanup $this->deleteWebhook($webhook['body']['$id']); @@ -2108,7 +2108,7 @@ trait WebhooksBase $this->assertArrayNotHasKey('authPassword', $updated['body']); $this->assertNotEmpty($updated['body']['signatureKey']); - $this->assertEquals(128, \strlen($updated['body']['signatureKey'])); + $this->assertSame(128, \strlen($updated['body']['signatureKey'])); // Cleanup $this->deleteWebhook($webhookId);