DSN changes check
This commit is contained in:
parent
37bdb17cc6
commit
e8a390bff6
|
@ -51,7 +51,7 @@
|
|||
"utopia-php/config": "0.2.*",
|
||||
"utopia-php/database": "0.45.*",
|
||||
"utopia-php/domains": "0.5.*",
|
||||
"utopia-php/dsn": "0.1.*",
|
||||
"utopia-php/dsn": "0.2.*",
|
||||
"utopia-php/framework": "0.32.*",
|
||||
"utopia-php/image": "0.5.*",
|
||||
"utopia-php/locale": "0.4.*",
|
||||
|
|
14
composer.lock
generated
14
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "f4d494d258630f4b7e9427becf73cd7b",
|
||||
"content-hash": "577d31a631d293cfa0ab47cf5308badd",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
|
@ -2028,16 +2028,16 @@
|
|||
},
|
||||
{
|
||||
"name": "utopia-php/dsn",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/dsn.git",
|
||||
"reference": "17a5935eab1b89fb4b95600db50a1b6d5faa6cea"
|
||||
"reference": "c11f37a12c3f6aaf9fea97ca7cb363dcc93668d7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/dsn/zipball/17a5935eab1b89fb4b95600db50a1b6d5faa6cea",
|
||||
"reference": "17a5935eab1b89fb4b95600db50a1b6d5faa6cea",
|
||||
"url": "https://api.github.com/repos/utopia-php/dsn/zipball/c11f37a12c3f6aaf9fea97ca7cb363dcc93668d7",
|
||||
"reference": "c11f37a12c3f6aaf9fea97ca7cb363dcc93668d7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2069,9 +2069,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/dsn/issues",
|
||||
"source": "https://github.com/utopia-php/dsn/tree/0.1.0"
|
||||
"source": "https://github.com/utopia-php/dsn/tree/0.2.0"
|
||||
},
|
||||
"time": "2022-10-26T10:06:20+00:00"
|
||||
"time": "2023-11-02T12:01:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/framework",
|
||||
|
|
|
@ -473,71 +473,63 @@ trait StorageBase
|
|||
$this->assertEquals(201, $fileJfif['headers']['status-code']);
|
||||
$this->assertNotEmpty($fileJfif['body']['$id']);
|
||||
|
||||
// TEST preview JXL
|
||||
$preview = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $fileJfif['body']['$id'] . '/preview', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
|
||||
// // shmuel
|
||||
// $data = file_get_contents(__DIR__ . '/../../../resources/disk-a/preview-test.jfif');
|
||||
// $image = new \Imagick();
|
||||
// $image->readImageBlob($data);
|
||||
// // End
|
||||
$this->assertEquals(200, $preview['headers']['status-code']);
|
||||
$this->assertEquals('image/jpeg', $preview['headers']['content-type']);
|
||||
$this->assertNotEmpty($preview['body']);
|
||||
|
||||
//
|
||||
// // TEST preview JXL
|
||||
// $preview = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $fileJfif['body']['$id'] . '/preview', array_merge([
|
||||
// 'content-type' => 'application/json',
|
||||
// 'x-appwrite-project' => $this->getProject()['$id'],
|
||||
// ], $this->getHeaders()));
|
||||
//
|
||||
// $this->assertEquals(200, $preview['headers']['status-code']);
|
||||
// $this->assertEquals('image/jpeg', $preview['headers']['content-type']);
|
||||
// $this->assertNotEmpty($preview['body']);
|
||||
//
|
||||
// //new image preview features
|
||||
// $file3 = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $data['fileId'] . '/preview', array_merge([
|
||||
// 'content-type' => 'application/json',
|
||||
// 'x-appwrite-project' => $this->getProject()['$id'],
|
||||
// ], $this->getHeaders()), [
|
||||
// 'width' => 300,
|
||||
// 'height' => 100,
|
||||
// 'borderRadius' => '50',
|
||||
// 'opacity' => '0.5',
|
||||
// 'output' => 'png',
|
||||
// 'rotation' => '45',
|
||||
// ]);
|
||||
//
|
||||
// $this->assertEquals(200, $file3['headers']['status-code']);
|
||||
// $this->assertEquals('image/png', $file3['headers']['content-type']);
|
||||
// $this->assertNotEmpty($file3['body']);
|
||||
//
|
||||
// $image = new \Imagick();
|
||||
// $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());
|
||||
//
|
||||
// $file4 = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $data['fileId'] . '/preview', array_merge([
|
||||
// 'content-type' => 'application/json',
|
||||
// 'x-appwrite-project' => $this->getProject()['$id'],
|
||||
// ], $this->getHeaders()), [
|
||||
// 'width' => 200,
|
||||
// 'height' => 80,
|
||||
// 'borderWidth' => '5',
|
||||
// 'borderColor' => 'ff0000',
|
||||
// 'output' => 'jpg',
|
||||
// ]);
|
||||
//
|
||||
// $this->assertEquals(200, $file4['headers']['status-code']);
|
||||
// $this->assertEquals('image/jpeg', $file4['headers']['content-type']);
|
||||
// $this->assertNotEmpty($file4['body']);
|
||||
//
|
||||
// $image = new \Imagick();
|
||||
// $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());
|
||||
//new image preview features
|
||||
$file3 = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $data['fileId'] . '/preview', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'width' => 300,
|
||||
'height' => 100,
|
||||
'borderRadius' => '50',
|
||||
'opacity' => '0.5',
|
||||
'output' => 'png',
|
||||
'rotation' => '45',
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $file3['headers']['status-code']);
|
||||
$this->assertEquals('image/png', $file3['headers']['content-type']);
|
||||
$this->assertNotEmpty($file3['body']);
|
||||
|
||||
$image = new \Imagick();
|
||||
$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());
|
||||
|
||||
$file4 = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $data['fileId'] . '/preview', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'width' => 200,
|
||||
'height' => 80,
|
||||
'borderWidth' => '5',
|
||||
'borderColor' => 'ff0000',
|
||||
'output' => 'jpg',
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $file4['headers']['status-code']);
|
||||
$this->assertEquals('image/jpeg', $file4['headers']['content-type']);
|
||||
$this->assertNotEmpty($file4['body']);
|
||||
|
||||
$image = new \Imagick();
|
||||
$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());
|
||||
|
||||
$file5 = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $data['fileId'] . '/download', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
|
|
Loading…
Reference in a new issue