Skip to content

Commit 859060b

Browse files
committed
test: move $expected lines
1 parent 695db91 commit 859060b

1 file changed

Lines changed: 23 additions & 24 deletions

File tree

tests/system/HTTP/URITest.php

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ public function testSetSchemeSetsValue()
184184
$url = 'http://example.com/path';
185185
$uri = new URI($url);
186186

187-
$expected = 'https://example.com/path';
188-
189187
$uri->setScheme('https');
188+
190189
$this->assertSame('https', $uri->getScheme());
190+
$expected = 'https://example.com/path';
191191
$this->assertSame($expected, (string) $uri);
192192
}
193193

@@ -196,10 +196,10 @@ public function testSetUserInfoSetsValue()
196196
$url = 'http://example.com/path';
197197
$uri = new URI($url);
198198

199-
$expected = 'http://user@example.com/path';
200-
201199
$uri->setUserInfo('user', 'password');
200+
202201
$this->assertSame('user', $uri->getUserInfo());
202+
$expected = 'http://user@example.com/path';
203203
$this->assertSame($expected, (string) $uri);
204204
}
205205

@@ -208,17 +208,16 @@ public function testUserInfoCanShowPassword()
208208
$url = 'http://example.com/path';
209209
$uri = new URI($url);
210210

211-
$expected = 'http://user@example.com/path';
212-
213211
$uri->setUserInfo('user', 'password');
212+
214213
$this->assertSame('user', $uri->getUserInfo());
214+
$expected = 'http://user@example.com/path';
215215
$this->assertSame($expected, (string) $uri);
216216

217217
$uri->showPassword();
218218

219-
$expected = 'http://user:password@example.com/path';
220-
221219
$this->assertSame('user:password', $uri->getUserInfo());
220+
$expected = 'http://user:password@example.com/path';
222221
$this->assertSame($expected, (string) $uri);
223222
}
224223

@@ -227,10 +226,10 @@ public function testSetHostSetsValue()
227226
$url = 'http://example.com/path';
228227
$uri = new URI($url);
229228

230-
$expected = 'http://another.com/path';
231-
232229
$uri->setHost('another.com');
230+
233231
$this->assertSame('another.com', $uri->getHost());
232+
$expected = 'http://another.com/path';
234233
$this->assertSame($expected, (string) $uri);
235234
}
236235

@@ -239,10 +238,10 @@ public function testSetPortSetsValue()
239238
$url = 'http://example.com/path';
240239
$uri = new URI($url);
241240

242-
$expected = 'http://example.com:9000/path';
243-
244241
$uri->setPort(9000);
242+
245243
$this->assertSame(9000, $uri->getPort());
244+
$expected = 'http://example.com:9000/path';
246245
$this->assertSame($expected, (string) $uri);
247246
}
248247

@@ -306,10 +305,10 @@ public function testSetPathSetsValue()
306305
$url = 'http://example.com/path';
307306
$uri = new URI($url);
308307

309-
$expected = 'http://example.com/somewhere/else';
310-
311308
$uri->setPath('somewhere/else');
309+
312310
$this->assertSame('somewhere/else', $uri->getPath());
311+
$expected = 'http://example.com/somewhere/else';
313312
$this->assertSame($expected, (string) $uri);
314313
}
315314

@@ -362,10 +361,10 @@ public function testSetFragmentSetsValue()
362361
$url = 'http://example.com/path';
363362
$uri = new URI($url);
364363

365-
$expected = 'http://example.com/path#good-stuff';
366-
367364
$uri->setFragment('#good-stuff');
365+
368366
$this->assertSame('good-stuff', $uri->getFragment());
367+
$expected = 'http://example.com/path#good-stuff';
369368
$this->assertSame($expected, (string) $uri);
370369
}
371370

@@ -374,10 +373,10 @@ public function testSetQuerySetsValue()
374373
$url = 'http://example.com/path';
375374
$uri = new URI($url);
376375

377-
$expected = 'http://example.com/path?key=value&second_key=value.2';
378-
379376
$uri->setQuery('?key=value&second.key=value.2');
377+
380378
$this->assertSame('key=value&second_key=value.2', $uri->getQuery());
379+
$expected = 'http://example.com/path?key=value&second_key=value.2';
381380
$this->assertSame($expected, (string) $uri);
382381
}
383382

@@ -386,10 +385,10 @@ public function testSetQuerySetsValueWithUseRawQueryString()
386385
$url = 'http://example.com/path';
387386
$uri = new URI($url);
388387

389-
$expected = 'http://example.com/path?key=value&second.key=value.2';
390-
391388
$uri->useRawQueryString()->setQuery('?key=value&second.key=value.2');
389+
392390
$this->assertSame('key=value&second.key=value.2', $uri->getQuery());
391+
$expected = 'http://example.com/path?key=value&second.key=value.2';
393392
$this->assertSame($expected, (string) $uri);
394393
}
395394

@@ -398,10 +397,10 @@ public function testSetQueryArraySetsValue()
398397
$url = 'http://example.com/path';
399398
$uri = new URI($url);
400399

401-
$expected = 'http://example.com/path?key=value&second_key=value.2';
402-
403400
$uri->setQueryArray(['key' => 'value', 'second.key' => 'value.2']);
401+
404402
$this->assertSame('key=value&second_key=value.2', $uri->getQuery());
403+
$expected = 'http://example.com/path?key=value&second_key=value.2';
405404
$this->assertSame($expected, (string) $uri);
406405
}
407406

@@ -410,10 +409,10 @@ public function testSetQueryArraySetsValueWithUseRawQueryString()
410409
$url = 'http://example.com/path';
411410
$uri = new URI($url);
412411

413-
$expected = 'http://example.com/path?key=value&second.key=value.2';
414-
415412
$uri->useRawQueryString()->setQueryArray(['key' => 'value', 'second.key' => 'value.2']);
413+
416414
$this->assertSame('key=value&second.key=value.2', $uri->getQuery());
415+
$expected = 'http://example.com/path?key=value&second.key=value.2';
417416
$this->assertSame($expected, (string) $uri);
418417
}
419418

0 commit comments

Comments
 (0)