|
@@ 140-156 (lines=17) @@
|
| 137 |
|
/** |
| 138 |
|
* Test serialization with included http host and port in the URI and include original option "true" |
| 139 |
|
*/ |
| 140 |
|
public function testHttpsSerialization() |
| 141 |
|
{ |
| 142 |
|
$userPictures = new UserPictures(); |
| 143 |
|
$this->generateCacheManager(); |
| 144 |
|
$this->generateRequestContext(true, true); |
| 145 |
|
$data = $this->serializeObject($userPictures, [ |
| 146 |
|
'includeHost' => true, |
| 147 |
|
'vichUploaderSerialize' => true, |
| 148 |
|
'includeOriginal' => true, |
| 149 |
|
]); |
| 150 |
|
|
| 151 |
|
static::assertEquals('https://example.com:8800/uploads/photo.jpg', $data['photo']); |
| 152 |
|
static::assertEquals('http://a/path/to/an/image1.png', $data['cover']['big']); |
| 153 |
|
static::assertEquals('http://a/path/to/an/image2.png', $data['cover']['small']); |
| 154 |
|
static::assertEquals('http://a/path/to/an/image3.png', $data['photoThumb']['thumb_filter']); |
| 155 |
|
static::assertEquals('/uploads/photo.jpg', $data['photoThumb']['original']); |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
/** |
| 159 |
|
* Test serialization without host in url and one filter |
|
@@ 179-195 (lines=17) @@
|
| 176 |
|
/** |
| 177 |
|
* Test serialization without host in url and array of filters |
| 178 |
|
*/ |
| 179 |
|
public function testSerializationWithoutHostManyFilters() |
| 180 |
|
{ |
| 181 |
|
$userPhotos = new UserPhotos(); |
| 182 |
|
$this->generateCacheManager('/'); |
| 183 |
|
$this->generateRequestContext(true, true); |
| 184 |
|
$data = $this->serializeObject($userPhotos, [ |
| 185 |
|
'includeHost' => false, |
| 186 |
|
'vichUploaderSerialize' => true, |
| 187 |
|
'includeOriginal' => false, |
| 188 |
|
]); |
| 189 |
|
|
| 190 |
|
static::assertEquals('/a/path/to/an/image1.png', $data['cover']['big']); |
| 191 |
|
static::assertEquals('/a/path/to/an/image2.png', $data['cover']['small']); |
| 192 |
|
static::assertEquals('/uploads/photo.jpg', $data['photo']); |
| 193 |
|
static::assertEquals('/a/path/to/an/image3.png', $data['photoThumb']['thumb_big']); |
| 194 |
|
static::assertEquals('/a/path/to/an/image4.png', $data['photoThumb']['thumb_small']); |
| 195 |
|
} |
| 196 |
|
|
| 197 |
|
/** |
| 198 |
|
* @param User|UserPictures $user |