Merge pull request #13176 from appwrite/bump-database-7-1-3

Bump database 7.1.3
This commit is contained in:
Shmuel Fogel authored and GitHub committed 2026-08-11 10:47:02 +03:00
commit 78f5085a68
17 files changed
+179 -173

No files matched your search

+3
View File
@@ -131,6 +131,9 @@
"config": {
"platform": {
},
"audit": {
"abandoned": "report"
},
"allow-plugins": {
"php-http/discovery": true,
"tbachert/spi": true
Generated
+60 -57
View File
@@ -157,6 +157,7 @@
"issues": "https://github.com/appwrite/php-clamav/issues",
"source": "https://github.com/appwrite/php-clamav/tree/2.0.0"
},
"abandoned": true,
"time": "2023-02-24T09:50:42+00:00"
},
{
@@ -3637,16 +3638,16 @@
},
{
"name": "utopia-php/database",
"version": "7.1.2",
"version": "7.1.3",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "9eed1f1ed7da154ca7356c5f051bbc192e7b3c73"
"reference": "ce4e14e11cf8f9e6897015d5a7f8bb44a4b74949"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/9eed1f1ed7da154ca7356c5f051bbc192e7b3c73",
"reference": "9eed1f1ed7da154ca7356c5f051bbc192e7b3c73",
"url": "https://api.github.com/repos/utopia-php/database/zipball/ce4e14e11cf8f9e6897015d5a7f8bb44a4b74949",
"reference": "ce4e14e11cf8f9e6897015d5a7f8bb44a4b74949",
"shasum": ""
},
"require": {
@@ -3691,9 +3692,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/7.1.2"
"source": "https://github.com/utopia-php/database/tree/7.1.3"
},
"time": "2026-08-10T04:39:43+00:00"
"time": "2026-08-10T12:17:57+00:00"
},
{
"name": "utopia-php/detector",
@@ -5419,16 +5420,16 @@
"packages-dev": [
{
"name": "appwrite/sdk-generator",
"version": "2.10.1",
"version": "2.11.1",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator.git",
"reference": "3019e3e939cc5f12a41dab98ded1043423467dd0"
"reference": "4bf377c6b8c4f9620d8e5fd525ab6160bdc95a41"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/3019e3e939cc5f12a41dab98ded1043423467dd0",
"reference": "3019e3e939cc5f12a41dab98ded1043423467dd0",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/4bf377c6b8c4f9620d8e5fd525ab6160bdc95a41",
"reference": "4bf377c6b8c4f9620d8e5fd525ab6160bdc95a41",
"shasum": ""
},
"require": {
@@ -5465,9 +5466,9 @@
"description": "SDK generator for Appwrite APIs across multiple programming languages and platforms",
"support": {
"issues": "https://github.com/appwrite/sdk-generator/issues",
"source": "https://github.com/appwrite/sdk-generator/tree/2.10.1"
"source": "https://github.com/appwrite/sdk-generator/tree/2.11.1"
},
"time": "2026-08-06T07:56:50+00:00"
"time": "2026-08-10T11:13:18+00:00"
},
{
"name": "brianium/paratest",
@@ -5749,16 +5750,16 @@
},
{
"name": "laravel/pint",
"version": "v1.29.3",
"version": "v1.30.5",
"source": {
"type": "git",
"url": "https://github.com/laravel/pint.git",
"reference": "da1d1111a6aa2e082d2a388b194afe1ba0a05d14"
"reference": "fe4148c503a0e266353d61396b79bbf7f35122df"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/da1d1111a6aa2e082d2a388b194afe1ba0a05d14",
"reference": "da1d1111a6aa2e082d2a388b194afe1ba0a05d14",
"url": "https://api.github.com/repos/laravel/pint/zipball/fe4148c503a0e266353d61396b79bbf7f35122df",
"reference": "fe4148c503a0e266353d61396b79bbf7f35122df",
"shasum": ""
},
"require": {
@@ -5766,17 +5767,19 @@
"ext-mbstring": "*",
"ext-tokenizer": "*",
"ext-xml": "*",
"php": "^8.2.0"
"php": "^8.3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.95.8",
"illuminate/view": "^12.62.0",
"composer/semver": "^3.4.4",
"friendsofphp/php-cs-fixer": "^3.95.18",
"illuminate/view": "^13.24.0",
"larastan/larastan": "^3.10.0",
"laravel-zero/framework": "^12.1.0",
"laravel-zero/framework": "^13.0.0",
"laravel/agent-detector": "^2.0.2",
"laravel/prompts": "^0.3.22",
"mockery/mockery": "^1.6.12",
"nunomaduro/termwind": "^2.4.0",
"pestphp/pest": "^3.8.6"
"pestphp/pest": "^4.7.8"
},
"bin": [
"builds/pint"
@@ -5813,7 +5816,7 @@
"issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint"
},
"time": "2026-06-16T15:34:04+00:00"
"time": "2026-08-10T15:35:50+00:00"
},
{
"name": "matthiasmullie/minify",
@@ -6175,11 +6178,11 @@
},
{
"name": "phpstan/phpstan",
"version": "2.2.6",
"version": "2.2.8",
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/a6e9b5a9420f6109c091e87d82683bd1a80b87ed",
"reference": "a6e9b5a9420f6109c091e87d82683bd1a80b87ed",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e285254e60f33c21902efef4a926ca0987c06804",
"reference": "e285254e60f33c21902efef4a926ca0987c06804",
"shasum": ""
},
"require": {
@@ -6235,7 +6238,7 @@
"type": "github"
}
],
"time": "2026-07-26T21:22:49+00:00"
"time": "2026-08-04T22:21:45+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -6584,16 +6587,16 @@
},
{
"name": "phpunit/phpunit",
"version": "12.5.32",
"version": "12.5.33",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "c02591dd7840ed124a98d7770753329ad28e9f8f"
"reference": "b98e028a26c5c5ba7e4a54be96ccf35f2914d184"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c02591dd7840ed124a98d7770753329ad28e9f8f",
"reference": "c02591dd7840ed124a98d7770753329ad28e9f8f",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b98e028a26c5c5ba7e4a54be96ccf35f2914d184",
"reference": "b98e028a26c5c5ba7e4a54be96ccf35f2914d184",
"shasum": ""
},
"require": {
@@ -6662,7 +6665,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.32"
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.33"
},
"funding": [
{
@@ -6670,20 +6673,20 @@
"type": "other"
}
],
"time": "2026-07-25T06:54:13+00:00"
"time": "2026-07-28T13:58:09+00:00"
},
{
"name": "rector/rector",
"version": "2.5.8",
"version": "2.6.1",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "861c77fd2a6d45317a401f4e0b617f947e8b6f96"
"reference": "b8e68f058bca43e01a2e1caa51ef022d6551ed95"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/861c77fd2a6d45317a401f4e0b617f947e8b6f96",
"reference": "861c77fd2a6d45317a401f4e0b617f947e8b6f96",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/b8e68f058bca43e01a2e1caa51ef022d6551ed95",
"reference": "b8e68f058bca43e01a2e1caa51ef022d6551ed95",
"shasum": ""
},
"require": {
@@ -6722,7 +6725,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/2.5.8"
"source": "https://github.com/rectorphp/rector/tree/2.6.1"
},
"funding": [
{
@@ -6730,7 +6733,7 @@
"type": "github"
}
],
"time": "2026-07-27T06:19:16+00:00"
"time": "2026-08-03T17:30:34+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -7727,16 +7730,16 @@
},
{
"name": "symfony/console",
"version": "v8.1.1",
"version": "v8.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "b711a8ab808b6c074c6b8caef70d0fd8d6b6d07d"
"reference": "68efa2ebfd9a362951eb5a8b09fd177c66ddec24"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/b711a8ab808b6c074c6b8caef70d0fd8d6b6d07d",
"reference": "b711a8ab808b6c074c6b8caef70d0fd8d6b6d07d",
"url": "https://api.github.com/repos/symfony/console/zipball/68efa2ebfd9a362951eb5a8b09fd177c66ddec24",
"reference": "68efa2ebfd9a362951eb5a8b09fd177c66ddec24",
"shasum": ""
},
"require": {
@@ -7803,7 +7806,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v8.1.1"
"source": "https://github.com/symfony/console/tree/v8.1.4"
},
"funding": [
{
@@ -7823,7 +7826,7 @@
"type": "tidelift"
}
],
"time": "2026-06-16T12:55:20+00:00"
"time": "2026-07-31T12:43:13+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -7910,16 +7913,16 @@
},
{
"name": "symfony/polyfill-intl-grapheme",
"version": "v1.38.1",
"version": "v1.41.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
"reference": "e9247d281d694a5120554d9afaf54e070e88a603"
"reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/e9247d281d694a5120554d9afaf54e070e88a603",
"reference": "e9247d281d694a5120554d9afaf54e070e88a603",
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/bb899c1db0aa8127dc3afe8cda4a67eb24915f8d",
"reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d",
"shasum": ""
},
"require": {
@@ -7968,7 +7971,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.38.1"
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.41.0"
},
"funding": [
{
@@ -7988,7 +7991,7 @@
"type": "tidelift"
}
],
"time": "2026-05-26T05:58:03+00:00"
"time": "2026-07-28T08:25:59+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
@@ -8142,16 +8145,16 @@
},
{
"name": "symfony/string",
"version": "v8.1.0",
"version": "v8.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "afd5944f4005862d961efb85c8bbd5c523c4e3c9"
"reference": "286a76b7255e5cc4bf0101a0bc5388ecf1c38ccc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/afd5944f4005862d961efb85c8bbd5c523c4e3c9",
"reference": "afd5944f4005862d961efb85c8bbd5c523c4e3c9",
"url": "https://api.github.com/repos/symfony/string/zipball/286a76b7255e5cc4bf0101a0bc5388ecf1c38ccc",
"reference": "286a76b7255e5cc4bf0101a0bc5388ecf1c38ccc",
"shasum": ""
},
"require": {
@@ -8208,7 +8211,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v8.1.0"
"source": "https://github.com/symfony/string/tree/v8.1.2"
},
"funding": [
{
@@ -8228,7 +8231,7 @@
"type": "tidelift"
}
],
"time": "2026-05-29T05:06:50+00:00"
"time": "2026-07-28T07:35:25+00:00"
},
{
"name": "textalk/websocket",
@@ -8436,5 +8439,5 @@
"platform-dev": {
"ext-fileinfo": "*"
},
"plugin-api-version": "2.9.0"
"plugin-api-version": "2.6.0"
}
+18 -18
View File
@@ -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
}
/**
+2 -2
View File
@@ -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
+17 -17
View File
@@ -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']);
+1 -1
View File
@@ -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']);
}
}
+15 -15
View File
@@ -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)) {
+1 -1
View File
@@ -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',
+15 -15
View File
@@ -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());
}
}
+2 -2
View File
@@ -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']);
/**
+6 -6
View File
@@ -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);