@@ 244-260 (lines=17) @@ | ||
241 | /** |
|
242 | * Test serialization with included http host and port in the URI and include original option "true" |
|
243 | */ |
|
244 | public function testHttpsSerialization(): void |
|
245 | { |
|
246 | $userPictures = new UserPictures(); |
|
247 | $this->generateCacheManager(); |
|
248 | $this->generateRequestContext(true, true); |
|
249 | $data = $this->serializeObject($userPictures, [ |
|
250 | 'includeHost' => true, |
|
251 | 'vichUploaderSerialize' => true, |
|
252 | 'includeOriginal' => true, |
|
253 | ]); |
|
254 | ||
255 | static::assertEquals('https://example.com:8800/uploads/photo.jpg', $data['photo']); |
|
256 | static::assertEquals('http://example.com:8800/a/path/to/an/image1.png', $data['cover']['big']); |
|
257 | static::assertEquals('http://example.com:8800/a/path/to/an/image2.png', $data['cover']['small']); |
|
258 | static::assertEquals('http://example.com:8800/a/path/to/an/image3.png', $data['photoThumb']['thumb_filter']); |
|
259 | static::assertEquals('/uploads/photo.jpg', $data['photoThumb']['original']); |
|
260 | } |
|
261 | ||
262 | /** |
|
263 | * Test serialization without host in url and one filter |
|
@@ 385-401 (lines=17) @@ | ||
382 | /** |
|
383 | * Test serialization without host in url and array of filters |
|
384 | */ |
|
385 | public function testSerializationWithoutHostManyFilters(): void |
|
386 | { |
|
387 | $userPhotos = new UserPhotos(); |
|
388 | $this->generateCacheManager('/'); |
|
389 | $this->generateRequestContext(true, true); |
|
390 | $data = $this->serializeObject($userPhotos, [ |
|
391 | 'includeHost' => false, |
|
392 | 'vichUploaderSerialize' => true, |
|
393 | 'includeOriginal' => false, |
|
394 | ]); |
|
395 | ||
396 | static::assertEquals('/a/path/to/an/image1.png', $data['cover']['big']); |
|
397 | static::assertEquals('/a/path/to/an/image2.png', $data['cover']['small']); |
|
398 | static::assertEquals('/uploads/photo.jpg', $data['photo']); |
|
399 | static::assertEquals('/a/path/to/an/image3.png', $data['photoThumb']['thumb_big']); |
|
400 | static::assertEquals('/a/path/to/an/image4.png', $data['photoThumb']['thumb_small']); |
|
401 | } |
|
402 | ||
403 | /** |
|
404 | * @param User|UserPictures|UserPhotos $user |