@@ -65,8 +65,11 @@ public function testBeforeTriggered(): void
6565 'after ' => [],
6666 ];
6767
68- $ this ->request = service ('request ' , null , false );
69- $ this ->response = service ('response ' );
68+ $ this ->request = service ('request ' , null , false );
69+
70+ $ response = service ('response ' );
71+ $ this ->assertInstanceOf (Response::class, $ response );
72+ $ this ->response = $ response ;
7073
7174 $ filters = new Filters ($ this ->config , $ this ->request , $ this ->response );
7275 $ uri = 'admin/foo/bar ' ;
@@ -83,8 +86,11 @@ public function testBeforeClean(): void
8386 ];
8487
8588 service ('superglobals ' )->unsetPost ($ this ->honey ->name );
86- $ this ->request = service ('request ' , null , false );
87- $ this ->response = service ('response ' );
89+ $ this ->request = service ('request ' , null , false );
90+
91+ $ response = service ('response ' );
92+ $ this ->assertInstanceOf (Response::class, $ response );
93+ $ this ->response = $ response ;
8894
8995 $ expected = $ this ->request ;
9096
@@ -104,14 +110,19 @@ public function testAfter(): void
104110 'after ' => ['honeypot ' ],
105111 ];
106112
107- $ this ->request = service ('request ' , null , false );
108- $ this ->response = service ('response ' );
113+ $ this ->request = service ('request ' , null , false );
114+
115+ $ response = service ('response ' );
116+ $ this ->assertInstanceOf (Response::class, $ response );
117+ $ this ->response = $ response ;
109118
110119 $ filters = new Filters ($ this ->config , $ this ->request , $ this ->response );
111120 $ uri = 'admin/foo/bar ' ;
112121
113122 $ this ->response ->setBody ('<form></form> ' );
114- $ this ->response = $ filters ->run ($ uri , 'after ' );
123+ $ response = $ filters ->run ($ uri , 'after ' );
124+ $ this ->assertInstanceOf (Response::class, $ response );
125+ $ this ->response = $ response ;
115126 $ this ->assertStringContainsString ($ this ->honey ->name , (string ) $ this ->response ->getBody ());
116127 }
117128
@@ -124,14 +135,19 @@ public function testAfterNotApplicable(): void
124135 'after ' => ['honeypot ' ],
125136 ];
126137
127- $ this ->request = service ('request ' , null , false );
128- $ this ->response = service ('response ' );
138+ $ this ->request = service ('request ' , null , false );
139+
140+ $ response = service ('response ' );
141+ $ this ->assertInstanceOf (Response::class, $ response );
142+ $ this ->response = $ response ;
129143
130144 $ filters = new Filters ($ this ->config , $ this ->request , $ this ->response );
131145 $ uri = 'admin/foo/bar ' ;
132146
133147 $ this ->response ->setBody ('<div></div> ' );
134- $ this ->response = $ filters ->run ($ uri , 'after ' );
148+ $ response = $ filters ->run ($ uri , 'after ' );
149+ $ this ->assertInstanceOf (Response::class, $ response );
150+ $ this ->response = $ response ;
135151 $ this ->assertStringNotContainsString ($ this ->honey ->name , (string ) $ this ->response ->getBody ());
136152 }
137153}
0 commit comments