mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
composer refactor
This commit is contained in:
1 parent
5b53216f8c
commit
e8faf20378
15 files changed
+116
-116
No files matched your search
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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']);
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user