33namespace JacobBennett \Http2ServerPush \Test ;
44
55use Illuminate \Http \Request ;
6+ use Illuminate \Support \Str ;
67use JacobBennett \Http2ServerPush \Middleware \AddHttp2ServerPush ;
78use Symfony \Component \HttpFoundation \Response ;
89
@@ -14,7 +15,7 @@ public function setUp()
1415 $ this ->middleware = new AddHttp2ServerPush ();
1516 }
1617
17-
18+
1819 /** @test */
1920 public function it_will_not_exceed_size_limit ()
2021 {
@@ -27,7 +28,7 @@ public function it_will_not_exceed_size_limit()
2728 $ this ->assertTrue (strlen ($ response ->headers ->get ('link ' )) <= $ limit );
2829 $ this ->assertCount (1 , explode (", " , $ response ->headers ->get ('link ' )));
2930 }
30-
31+
3132 /** @test */
3233 public function it_will_not_add_excluded_asset ()
3334 {
@@ -36,10 +37,10 @@ public function it_will_not_add_excluded_asset()
3637 $ response = $ this ->middleware ->handle ($ request , $ this ->getNext ('pageWithCssAndJs ' ), null , null , ['thing ' ]);
3738
3839 $ this ->assertTrue ($ this ->isServerPushResponse ($ response ));
39- $ this ->assertTrue (!str_contains ($ response ->headers , 'thing ' ));
40+ $ this ->assertTrue (!Str:: contains ($ response ->headers , 'thing ' ));
4041 $ this ->assertCount (1 , explode (", " , $ response ->headers ->get ('link ' )));
4142 }
42-
43+
4344 /** @test */
4445 public function it_will_not_modify_a_response_with_no_server_push_assets ()
4546 {
@@ -114,8 +115,8 @@ public function it_will_return_correct_push_headers_for_multiple_assets()
114115 $ response = $ this ->middleware ->handle ($ request , $ this ->getNext ('pageWithCssAndJs ' ));
115116
116117 $ this ->assertTrue ($ this ->isServerPushResponse ($ response ));
117- $ this ->assertTrue (str_contains ($ response ->headers , 'style ' ));
118- $ this ->assertTrue (str_contains ($ response ->headers , 'script ' ));
118+ $ this ->assertTrue (Str:: contains ($ response ->headers , 'style ' ));
119+ $ this ->assertTrue (Str:: contains ($ response ->headers , 'script ' ));
119120 $ this ->assertCount (2 , explode (", " , $ response ->headers ->get ('link ' )));
120121 }
121122
0 commit comments