1
0
mirror of synced 2024-11-21 19:36:02 +03:00

Fixed url deserialization in getFileById() method (#35)

* Added tests to reproduce issue
* Fixed url deserialization in getFileById() method
This commit is contained in:
max-baranikov 2023-04-27 14:27:18 +03:00 committed by GitHub
parent 6ec1f00df9
commit c024350882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,7 @@
namespace RetailCrm\Mg\Bot\Model\Response;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
@ -55,6 +56,7 @@ class FullFileResponse implements ModelInterface
* @var string $url
*
* @Type("string")
* @SerializedName("Url")
* @Accessor(getter="getUrl",setter="setUrl")
* @SkipWhenEmpty()
*/

View File

@ -116,5 +116,8 @@ class FileTest extends TestCase
self::assertInstanceOf(FullFileResponse::class, $response);
self::assertEquals($fileId, $response->getId());
$fileUrl = 'https://s3.eu-central-1.amazonaws.com/mg-node-files/files/21/b2bdba90-166c-4e0a-829d-69f26a09fd2a';
self::assertEquals($fileUrl, $response->getUrl());
}
}