Fixed url deserialization in getFileById() method (#35)
* Added tests to reproduce issue * Fixed url deserialization in getFileById() method
This commit is contained in:
parent
6ec1f00df9
commit
c024350882
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
namespace RetailCrm\Mg\Bot\Model\Response;
|
namespace RetailCrm\Mg\Bot\Model\Response;
|
||||||
|
|
||||||
|
use JMS\Serializer\Annotation\SerializedName;
|
||||||
use JMS\Serializer\Annotation\Accessor;
|
use JMS\Serializer\Annotation\Accessor;
|
||||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||||
use JMS\Serializer\Annotation\Type;
|
use JMS\Serializer\Annotation\Type;
|
||||||
@ -55,6 +56,7 @@ class FullFileResponse implements ModelInterface
|
|||||||
* @var string $url
|
* @var string $url
|
||||||
*
|
*
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
|
* @SerializedName("Url")
|
||||||
* @Accessor(getter="getUrl",setter="setUrl")
|
* @Accessor(getter="getUrl",setter="setUrl")
|
||||||
* @SkipWhenEmpty()
|
* @SkipWhenEmpty()
|
||||||
*/
|
*/
|
||||||
|
@ -116,5 +116,8 @@ class FileTest extends TestCase
|
|||||||
|
|
||||||
self::assertInstanceOf(FullFileResponse::class, $response);
|
self::assertInstanceOf(FullFileResponse::class, $response);
|
||||||
self::assertEquals($fileId, $response->getId());
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user