@@ -375,12 +375,12 @@ public function testSubmitForm()
375
375
$ client ->setNextResponse (new Response ('<html><form name="signup" action="/foo"><input type="text" name="username" value="the username" /><input type="password" name="password" value="the password" /><input type="submit" value="Register" /></form></html> ' ));
376
376
$ client ->request ('GET ' , 'http://www.example.com/foo/foobar ' );
377
377
378
- $ client ->submitForm ('Register ' , array (
378
+ $ client ->submitForm ('Register ' , [
379
379
'username ' => 'new username ' ,
380
380
'password ' => 'new password ' ,
381
- ) , 'PUT ' , array (
381
+ ] , 'PUT ' , [
382
382
'HTTP_USER_AGENT ' => 'Symfony User Agent ' ,
383
- ) );
383
+ ] );
384
384
385
385
$ this ->assertEquals ('http://www.example.com/foo ' , $ client ->getRequest ()->getUri (), '->submitForm() submit forms ' );
386
386
$ this ->assertEquals ('PUT ' , $ client ->getRequest ()->getMethod (), '->submitForm() allows to change the method ' );
@@ -396,10 +396,10 @@ public function testSubmitFormNotFound()
396
396
$ client ->request ('GET ' , 'http://www.example.com/foo/foobar ' );
397
397
398
398
try {
399
- $ client ->submitForm ('Register ' , array (
399
+ $ client ->submitForm ('Register ' , [
400
400
'username ' => 'username ' ,
401
401
'password ' => 'password ' ,
402
- ) , 'POST ' );
402
+ ] , 'POST ' );
403
403
$ this ->fail ('->submitForm() throws a \InvalidArgumentException if the form could not be found ' );
404
404
} catch (\Exception $ e ) {
405
405
$ this ->assertInstanceOf ('InvalidArgumentException ' , $ e , '->submitForm() throws a \InvalidArgumentException if the form could not be found ' );
@@ -670,23 +670,23 @@ public function testFollowMetaRefresh(string $content, string $expectedEndingUrl
670
670
671
671
public function getTestsForMetaRefresh ()
672
672
{
673
- return array (
674
- array ( '<html><head><meta http-equiv="Refresh" content="4" /><meta http-equiv="refresh" content="0; URL=http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/redirected ' ) ,
675
- array ( '<html><head><meta http-equiv="refresh" content="0;URL=http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/redirected ' ) ,
676
- array ( '<html><head><meta http-equiv="refresh" content="0;URL= \'http://www.example.com/redirected \'"/></head></html> ' , 'http://www.example.com/redirected ' ) ,
677
- array ( '<html><head><meta http-equiv="refresh" content= \'0;URL="http://www.example.com/redirected" \'/></head></html> ' , 'http://www.example.com/redirected ' ) ,
678
- array ( '<html><head><meta http-equiv="refresh" content="0; URL = http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/redirected ' ) ,
679
- array ( '<html><head><meta http-equiv="refresh" content="0;URL= http://www.example.com/redirected "/></head></html> ' , 'http://www.example.com/redirected ' ) ,
680
- array ( '<html><head><meta http-equiv="refresh" content="0;url=http://www.example.com/redirected "/></head></html> ' , 'http://www.example.com/redirected ' ) ,
681
- array ( '<html><head><noscript><meta http-equiv="refresh" content="0;URL=http://www.example.com/redirected"/></noscript></head></head></html> ' , 'http://www.example.com/redirected ' ) ,
673
+ return [
674
+ [ '<html><head><meta http-equiv="Refresh" content="4" /><meta http-equiv="refresh" content="0; URL=http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/redirected ' ] ,
675
+ [ '<html><head><meta http-equiv="refresh" content="0;URL=http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/redirected ' ] ,
676
+ [ '<html><head><meta http-equiv="refresh" content="0;URL= \'http://www.example.com/redirected \'"/></head></html> ' , 'http://www.example.com/redirected ' ] ,
677
+ [ '<html><head><meta http-equiv="refresh" content= \'0;URL="http://www.example.com/redirected" \'/></head></html> ' , 'http://www.example.com/redirected ' ] ,
678
+ [ '<html><head><meta http-equiv="refresh" content="0; URL = http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/redirected ' ] ,
679
+ [ '<html><head><meta http-equiv="refresh" content="0;URL= http://www.example.com/redirected "/></head></html> ' , 'http://www.example.com/redirected ' ] ,
680
+ [ '<html><head><meta http-equiv="refresh" content="0;url=http://www.example.com/redirected "/></head></html> ' , 'http://www.example.com/redirected ' ] ,
681
+ [ '<html><head><noscript><meta http-equiv="refresh" content="0;URL=http://www.example.com/redirected"/></noscript></head></head></html> ' , 'http://www.example.com/redirected ' ] ,
682
682
// Non-zero timeout should not result in a redirect.
683
- array ( '<html><head><meta http-equiv="refresh" content="4; URL=http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/foo/foobar ' ) ,
684
- array ( '<html><body></body></html> ' , 'http://www.example.com/foo/foobar ' ) ,
683
+ [ '<html><head><meta http-equiv="refresh" content="4; URL=http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/foo/foobar ' ] ,
684
+ [ '<html><body></body></html> ' , 'http://www.example.com/foo/foobar ' ] ,
685
685
// Invalid meta tag placement should not result in a redirect.
686
- array ( '<html><body><meta http-equiv="refresh" content="0;url=http://www.example.com/redirected"/></body></html> ' , 'http://www.example.com/foo/foobar ' ) ,
686
+ [ '<html><body><meta http-equiv="refresh" content="0;url=http://www.example.com/redirected"/></body></html> ' , 'http://www.example.com/foo/foobar ' ] ,
687
687
// Valid meta refresh should not be followed if disabled.
688
- array ( '<html><head><meta http-equiv="refresh" content="0;URL=http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/foo/foobar ' , false ) ,
689
- ) ;
688
+ [ '<html><head><meta http-equiv="refresh" content="0;URL=http://www.example.com/redirected"/></head></html> ' , 'http://www.example.com/foo/foobar ' , false ] ,
689
+ ] ;
690
690
}
691
691
692
692
public function testBack ()
@@ -927,7 +927,7 @@ protected function doRequest($request)
927
927
return $ response ;
928
928
}
929
929
930
- public function submit (DomCrawlerForm $ form , array $ values = array () )
930
+ public function submit (DomCrawlerForm $ form , array $ values = [] )
931
931
{
932
932
return parent ::submit ($ form , $ values );
933
933
}
0 commit comments