|
13 | 13 | $builder = new UrlBuilder('https://images.example.com'); |
14 | 14 | $url = $builder->buildUrl('images/image.jpg', $options); |
15 | 15 |
|
16 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?w=300&h=400&fit=fill&markpos=center'); |
| 16 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?w=300&h=400&fit=fill&markpos=center'); |
17 | 17 | }); |
18 | 18 |
|
19 | 19 | test('can build a basic URL without any options', function (): void { |
|
22 | 22 | $builder = new UrlBuilder('https://images.example.com'); |
23 | 23 | $url = $builder->buildUrl('images/image.jpg', $options); |
24 | 24 |
|
25 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?'); |
| 25 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?'); |
26 | 26 | }); |
27 | 27 |
|
28 | 28 | test('can build URL with null options', function (): void { |
29 | 29 | $builder = new UrlBuilder('https://images.example.com'); |
30 | 30 | $url = $builder->buildUrl('images/image.jpg', null); |
31 | 31 |
|
32 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?'); |
| 32 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?'); |
33 | 33 | }); |
34 | 34 |
|
35 | 35 | test('can handle URLs with leading/trailing slashes', function (): void { |
|
40 | 40 | $builder = new UrlBuilder('https://images.example.com'); |
41 | 41 | $url = $builder->buildUrl('/images/image.jpg/', $options); |
42 | 42 |
|
43 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?w=300'); |
| 43 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?w=300'); |
44 | 44 | }); |
45 | 45 |
|
46 | 46 | test('can build URL with quality and format options', function (): void { |
|
54 | 54 | $builder = new UrlBuilder('https://images.example.com'); |
55 | 55 | $url = $builder->buildUrl('images/image.jpg', $options); |
56 | 56 |
|
57 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?w=300&h=400&q=85&fm=webp'); |
| 57 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?w=300&h=400&q=85&fm=webp'); |
58 | 58 | }); |
59 | 59 |
|
60 | 60 | test('can build URL with watermark options', function (): void { |
|
68 | 68 | $builder = new UrlBuilder('https://images.example.com'); |
69 | 69 | $url = $builder->buildUrl('images/image.jpg', $options); |
70 | 70 |
|
71 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?w=300&h=400&markpos=center&markalpha=50'); |
| 71 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?w=300&h=400&markpos=center&markalpha=50'); |
72 | 72 | }); |
73 | 73 |
|
74 | 74 | test('can build URL with enhancement options', function (): void { |
|
84 | 84 | $builder = new UrlBuilder('https://images.example.com'); |
85 | 85 | $url = $builder->buildUrl('images/image.jpg', $options); |
86 | 86 |
|
87 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?w=300&h=400&bri=10&con=15&sharp=3&blur=2'); |
| 87 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?w=300&h=400&bri=10&con=15&sharp=3&blur=2'); |
88 | 88 | }); |
89 | 89 |
|
90 | 90 | test('can build URL with filter options', function (): void { |
|
97 | 97 | $builder = new UrlBuilder('https://images.example.com'); |
98 | 98 | $url = $builder->buildUrl('images/image.jpg', $options); |
99 | 99 |
|
100 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?w=300&h=400&filt=grayscale'); |
| 100 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?w=300&h=400&filt=grayscale'); |
101 | 101 | }); |
102 | 102 |
|
103 | 103 | test('can build URL with crop options', function (): void { |
|
107 | 107 | $builder = new UrlBuilder('https://images.example.com'); |
108 | 108 | $url = $builder->buildUrl('images/image.jpg', $options); |
109 | 109 |
|
110 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?crop=100,200,10,20'); |
| 110 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?crop=100,200,10,20'); |
111 | 111 | }); |
112 | 112 |
|
113 | 113 | test('can build URL with background and border options', function (): void { |
|
118 | 118 | $builder = new UrlBuilder('https://images.example.com'); |
119 | 119 | $url = $builder->buildUrl('images/image.jpg', $options); |
120 | 120 |
|
121 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?bg=ffffff&border=5,ff0000,overlay'); |
| 121 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?bg=ffffff&border=5,ff0000,overlay'); |
122 | 122 | }); |
123 | 123 |
|
124 | 124 | test('can build URL with boolean options', function (): void { |
|
128 | 128 | $builder = new UrlBuilder('https://images.example.com'); |
129 | 129 | $url = $builder->buildUrl('images/image.jpg', $options); |
130 | 130 |
|
131 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?interlace=1'); |
| 131 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?interlace=1'); |
132 | 132 | }); |
133 | 133 |
|
134 | 134 | test('can build URL with fit options', function (): void { |
|
138 | 138 | $builder = new UrlBuilder('https://images.example.com'); |
139 | 139 | $url = $builder->buildUrl('images/image.jpg', $options); |
140 | 140 |
|
141 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?fit=contain'); |
| 141 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?fit=contain'); |
142 | 142 | }); |
143 | 143 |
|
144 | 144 | test('can build URL with orientation and flip options', function (): void { |
|
149 | 149 | $builder = new UrlBuilder('https://images.example.com'); |
150 | 150 | $url = $builder->buildUrl('images/image.jpg', $options); |
151 | 151 |
|
152 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?or=90&flip=h'); |
| 152 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?or=90&flip=h'); |
153 | 153 | }); |
154 | 154 |
|
155 | 155 | test('can build URL with device pixel ratio', function (): void { |
|
159 | 159 | $builder = new UrlBuilder('https://images.example.com'); |
160 | 160 | $url = $builder->buildUrl('images/image.jpg', $options); |
161 | 161 |
|
162 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?dpr=2'); |
| 162 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?dpr=2'); |
163 | 163 | }); |
164 | 164 |
|
165 | 165 | test('can build URL with gamma adjustment', function (): void { |
|
169 | 169 | $builder = new UrlBuilder('https://images.example.com'); |
170 | 170 | $url = $builder->buildUrl('images/image.jpg', $options); |
171 | 171 |
|
172 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?gam=1.5'); |
| 172 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?gam=1.5'); |
173 | 173 | }); |
174 | 174 |
|
175 | 175 | test('can build URL with pixelate effect', function (): void { |
|
179 | 179 | $builder = new UrlBuilder('https://images.example.com'); |
180 | 180 | $url = $builder->buildUrl('images/image.jpg', $options); |
181 | 181 |
|
182 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?pixel=10'); |
| 182 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?pixel=10'); |
183 | 183 | }); |
184 | 184 |
|
185 | 185 | test('can build URL with watermark path', function (): void { |
|
189 | 189 | $builder = new UrlBuilder('https://images.example.com'); |
190 | 190 | $url = $builder->buildUrl('images/image.jpg', $options); |
191 | 191 |
|
192 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?mark=/watermarks/logo.png'); |
| 192 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?mark=/watermarks/logo.png'); |
193 | 193 | }); |
194 | 194 |
|
195 | 195 | test('can build URL with watermark dimensions', function (): void { |
|
200 | 200 | $builder = new UrlBuilder('https://images.example.com'); |
201 | 201 | $url = $builder->buildUrl('images/image.jpg', $options); |
202 | 202 |
|
203 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?markw=100&markh=50'); |
| 203 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?markw=100&markh=50'); |
204 | 204 | }); |
205 | 205 |
|
206 | 206 | test('can build URL with watermark offsets and padding', function (): void { |
|
212 | 212 | $builder = new UrlBuilder('https://images.example.com'); |
213 | 213 | $url = $builder->buildUrl('images/image.jpg', $options); |
214 | 214 |
|
215 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?markx=10&marky=20&markpad=5'); |
| 215 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?markx=10&marky=20&markpad=5'); |
216 | 216 | }); |
217 | 217 |
|
218 | 218 | test('can build URL with watermark fit', function (): void { |
|
222 | 222 | $builder = new UrlBuilder('https://images.example.com'); |
223 | 223 | $url = $builder->buildUrl('images/image.jpg', $options); |
224 | 224 |
|
225 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?markfit=contain'); |
| 225 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?markfit=contain'); |
226 | 226 | }); |
227 | 227 |
|
228 | 228 | test('can generate signed URLs', function (): void { |
|
236 | 236 | $builder = new UrlBuilder('https://images.example.com', $secret); |
237 | 237 | $url = $builder->buildUrl('images/image.jpg', $options); |
238 | 238 |
|
239 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?w=300&h=400&signature=S0b0bvBhc0kh2L6WRhcYGaRVT1LsuzWwONsdROoBk'); |
| 239 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?w=300&h=400&signature=Qaqt9agh3JLg4LeWmRqqd9qnD9bjPbVqSzrXAXTaY'); |
240 | 240 | }); |
241 | 241 |
|
242 | 242 | test('can generate complex signed URLs', function (): void { |
|
251 | 251 | $builder = new UrlBuilder('https://images.example.com', $secret); |
252 | 252 | $url = $builder->buildUrl('images/image.jpg', $options); |
253 | 253 |
|
254 | | - expect($url)->toBe('https://images.example.com/images/image.jpg?border=5,ff0000,overlay&q=80&fm=png&signature=NBzER5uyLXXVZGFMAXWjthvfYWCVaj754FoMWujdaeI'); |
| 254 | + expect($url)->toBe('https://images.example.com/t/images/image.jpg?border=5,ff0000,overlay&q=80&fm=png&signature=hE2e5tLayrNP0pgSaxJLFOMfi0PES2erIzhNYR7QqQ'); |
255 | 255 | }); |
0 commit comments