1212
1313class QueryDetectorTest extends TestCase
1414{
15- /** @test */
16- public function it_detects_n1_query_on_properties ()
15+ public function test_it_detects_n1_query_on_properties ()
1716 {
1817 Route::get ('/ ' , function (){
1918 $ authors = Author::all ();
@@ -34,8 +33,7 @@ public function it_detects_n1_query_on_properties()
3433 $ this ->assertSame ('profile ' , $ queries [0 ]['relation ' ]);
3534 }
3635
37- /** @test */
38- public function it_detects_n1_query_on_multiple_requests ()
36+ public function test_it_detects_n1_query_on_multiple_requests ()
3937 {
4038 Route::get ('/ ' , function (){
4139 $ authors = Author::get ();
@@ -62,8 +60,7 @@ public function it_detects_n1_query_on_multiple_requests()
6260 $ this ->assertSame ('profile ' , $ queries [0 ]['relation ' ]);
6361 }
6462
65- /** @test */
66- public function it_does_not_detect_a_false_n1_query_on_multiple_requests ()
63+ public function test_it_does_not_detect_a_false_n1_query_on_multiple_requests ()
6764 {
6865 Route::get ('/ ' , function (){
6966 $ authors = Author::with ("profile " )->get ();
@@ -82,8 +79,7 @@ public function it_does_not_detect_a_false_n1_query_on_multiple_requests()
8279 $ this ->assertCount (0 , app (QueryDetector::class)->getDetectedQueries ());
8380 }
8481
85- /** @test */
86- public function it_ignores_eager_loaded_relationships ()
82+ public function test_it_ignores_eager_loaded_relationships ()
8783 {
8884 Route::get ('/ ' , function (){
8985 $ authors = Author::with ('profile ' )->get ();
@@ -100,8 +96,7 @@ public function it_ignores_eager_loaded_relationships()
10096 $ this ->assertCount (0 , $ queries );
10197 }
10298
103- /** @test */
104- public function it_detects_n1_queries_from_builder ()
99+ public function test_it_detects_n1_queries_from_builder ()
105100 {
106101 Route::get ('/ ' , function (){
107102 $ authors = Author::with ('profile ' )->get ();
@@ -123,8 +118,7 @@ public function it_detects_n1_queries_from_builder()
123118 $ this ->assertSame (Post::class, $ queries [0 ]['relation ' ]);
124119 }
125120
126- /** @test */
127- public function it_detects_all_n1_queries ()
121+ public function test_it_detects_all_n1_queries ()
128122 {
129123 Route::get ('/ ' , function (){
130124 $ authors = Author::with ('profile ' )->get ();
@@ -154,8 +148,7 @@ public function it_detects_all_n1_queries()
154148 $ this ->assertSame ('author ' , $ queries [1 ]['relation ' ]);
155149 }
156150
157- /** @test */
158- public function it_detects_n1_queries_on_morph_relations ()
151+ public function test_it_detects_n1_queries_on_morph_relations ()
159152 {
160153 Route::get ('/ ' , function (){
161154 foreach (Post::all () as $ post ) {
@@ -174,8 +167,7 @@ public function it_detects_n1_queries_on_morph_relations()
174167 $ this ->assertSame ('comments ' , $ queries [0 ]['relation ' ]);
175168 }
176169
177- /** @test */
178- public function it_detects_n1_queries_on_morph_relations_with_builder ()
170+ public function test_it_detects_n1_queries_on_morph_relations_with_builder ()
179171 {
180172 Route::get ('/ ' , function (){
181173 foreach (Post::all () as $ post ) {
@@ -194,8 +186,7 @@ public function it_detects_n1_queries_on_morph_relations_with_builder()
194186 $ this ->assertSame (Comment::class, $ queries [0 ]['relation ' ]);
195187 }
196188
197- /** @test */
198- public function it_can_be_disabled ()
189+ public function test_it_can_be_disabled ()
199190 {
200191 $ this ->app ['config ' ]->set ('querydetector.enabled ' , false );
201192
@@ -212,8 +203,7 @@ public function it_can_be_disabled()
212203 $ this ->assertCount (0 , $ queries );
213204 }
214205
215- /** @test */
216- public function it_ignores_whitelisted_relations ()
206+ public function test_it_ignores_whitelisted_relations ()
217207 {
218208 $ this ->app ['config ' ]->set ('querydetector.enabled ' , true );
219209 $ this ->app ['config ' ]->set ('querydetector.except ' , [
@@ -235,8 +225,7 @@ public function it_ignores_whitelisted_relations()
235225 $ this ->assertCount (0 , $ queries );
236226 }
237227
238- /** @test */
239- public function it_ignores_whitelisted_relations_with_attributes ()
228+ public function test_it_ignores_whitelisted_relations_with_attributes ()
240229 {
241230 $ this ->app ['config ' ]->set ('querydetector.enabled ' , true );
242231 $ this ->app ['config ' ]->set ('querydetector.except ' , [
@@ -258,8 +247,7 @@ public function it_ignores_whitelisted_relations_with_attributes()
258247 $ this ->assertCount (0 , $ queries );
259248 }
260249
261- /** @test */
262- public function it_ignores_redirects ()
250+ public function test_it_ignores_redirects ()
263251 {
264252 Route::get ('/ ' , function (){
265253 foreach (Post::all () as $ post ) {
@@ -275,8 +263,7 @@ public function it_ignores_redirects()
275263 $ this ->assertCount (1 , $ queries );
276264 }
277265
278- /** @test */
279- public function it_fires_an_event_if_detects_n1_query ()
266+ public function test_it_fires_an_event_if_detects_n1_query ()
280267 {
281268 Event::fake ();
282269
@@ -293,8 +280,7 @@ public function it_fires_an_event_if_detects_n1_query()
293280 Event::assertDispatched (QueryDetected::class);
294281 }
295282
296- /** @test */
297- public function it_does_not_fire_an_event_if_there_is_no_n1_query ()
283+ public function test_it_does_not_fire_an_event_if_there_is_no_n1_query ()
298284 {
299285 Event::fake ();
300286
@@ -310,8 +296,7 @@ public function it_does_not_fire_an_event_if_there_is_no_n1_query()
310296
311297 Event::assertNotDispatched (QueryDetected::class);
312298 }
313- /** @test */
314- public function it_uses_the_trace_line_to_detect_queries ()
299+ public function test_it_uses_the_trace_line_to_detect_queries ()
315300 {
316301 Route::get ('/ ' , function (){
317302 $ authors = Author::all ();
@@ -337,8 +322,7 @@ public function it_uses_the_trace_line_to_detect_queries()
337322 $ this ->assertSame ('profile ' , $ queries [0 ]['relation ' ]);
338323 }
339324
340- /** @test */
341- public function it_empty_queries ()
325+ public function test_it_empty_queries ()
342326 {
343327 Route::get ('/ ' , function (){
344328 $ authors = Author::all ();
0 commit comments