33namespace Dingo \Blueprint \Tests ;
44
55use Dingo \Blueprint \Blueprint ;
6+ use Doctrine \Common \Annotations \AnnotationReader ;
67use PHPUnit \Framework \TestCase ;
78use Illuminate \Support \Collection ;
89use Illuminate \Filesystem \Filesystem ;
9- use Doctrine \Common \Annotations \SimpleAnnotationReader ;
1010
1111class BlueprintTest extends TestCase
1212{
1313 public function testGeneratingBlueprintForSingleResource ()
1414 {
1515 $ resources = new Collection ([new Stubs \UsersResourceStub ]);
1616
17- $ blueprint = new Blueprint (new SimpleAnnotationReader , new Filesystem );
17+ $ blueprint = new Blueprint (new AnnotationReader () , new Filesystem );
1818
1919 $ expected = <<<'EOT'
2020FORMAT: 1A
@@ -106,14 +106,17 @@ public function testGeneratingBlueprintForSingleResource()
106106 }
107107EOT;
108108
109- $ this ->assertEquals (trim ($ expected ), $ blueprint ->generate ($ resources , 'testing ' , 'v1 ' , null ));
109+ $ this ->assertEquals (
110+ trim ($ expected ),
111+ $ blueprint ->generate ($ resources , 'testing ' , 'v1 ' , null )
112+ );
110113 }
111114
112115 public function testGeneratingBlueprintForMultipleResourcesWithVersionOne ()
113116 {
114117 $ resources = new Collection ([new Stubs \UsersResourceStub , new Stubs \UserPhotosResourceStub ]);
115118
116- $ blueprint = new Blueprint (new SimpleAnnotationReader , new Filesystem );
119+ $ blueprint = new Blueprint (new AnnotationReader () , new Filesystem );
117120
118121 $ expected = <<<'EOT'
119122FORMAT: 1A
@@ -265,14 +268,17 @@ public function testGeneratingBlueprintForMultipleResourcesWithVersionOne()
265268 }
266269EOT;
267270
268- $ this ->assertEquals (trim ($ expected ), $ blueprint ->generate ($ resources , 'testing ' , 'v1 ' , null ));
271+ $ this ->assertEquals (
272+ trim ($ expected ),
273+ $ blueprint ->generate ($ resources , 'testing ' , 'v1 ' , null )
274+ );
269275 }
270276
271277 public function testGeneratingBlueprintForMultipleResourcesWithVersionTwo ()
272278 {
273279 $ resources = new Collection ([new Stubs \UsersResourceStub , new Stubs \UserPhotosResourceStub ]);
274280
275- $ blueprint = new Blueprint (new SimpleAnnotationReader , new Filesystem );
281+ $ blueprint = new Blueprint (new AnnotationReader () , new Filesystem );
276282
277283 $ expected = <<<'EOT'
278284FORMAT: 1A
@@ -466,14 +472,17 @@ public function testGeneratingBlueprintForMultipleResourcesWithVersionTwo()
466472 }
467473EOT;
468474
469- $ this ->assertEquals (trim ($ expected ), $ blueprint ->generate ($ resources , 'testing ' , 'v2 ' , null ));
475+ $ this ->assertEquals (
476+ trim ($ expected ),
477+ $ blueprint ->generate ($ resources , 'testing ' , 'v2 ' , null )
478+ );
470479 }
471480
472481 public function testGeneratingSimpleBlueprints ()
473482 {
474483 $ resources = new Collection ([new Stubs \ActivityController ]);
475484
476- $ blueprint = new Blueprint (new SimpleAnnotationReader , new Filesystem );
485+ $ blueprint = new Blueprint (new AnnotationReader () , new Filesystem );
477486
478487 $ expected = <<<'EOT'
479488FORMAT: 1A
@@ -492,7 +501,7 @@ public function testGeneratingBlueprintOverview()
492501 {
493502 $ resources = new Collection ([new Stubs \ActivityController ]);
494503
495- $ blueprint = new Blueprint (new SimpleAnnotationReader , new Filesystem );
504+ $ blueprint = new Blueprint (new AnnotationReader () , new Filesystem );
496505
497506 $ expected = <<<'EOT'
498507FORMAT: 1A
@@ -506,8 +515,9 @@ public function testGeneratingBlueprintOverview()
506515## Show all activities. [GET /activity]
507516EOT;
508517
509- $ this ->assertEquals (trim ($ expected ), $ blueprint ->generate ($ resources , 'testing ' , 'v1 ' , null , __DIR__ .'/Files/overview.apib ' ));
510-
511-
518+ $ this ->assertEquals (
519+ trim ($ expected ),
520+ $ blueprint ->generate ($ resources , 'testing ' , 'v1 ' , null , __DIR__ .'/Files/overview.apib ' )
521+ );
512522 }
513523}
0 commit comments