File tree Expand file tree Collapse file tree 3 files changed +26
-15
lines changed Expand file tree Collapse file tree 3 files changed +26
-15
lines changed Original file line number Diff line number Diff line change 1515use RonasIT \AutoDoc \Tests \Support \Mock \TestNotificationSetting ;
1616use RonasIT \AutoDoc \Tests \Support \Mock \TestRequest ;
1717use RonasIT \AutoDoc \Tests \Support \Traits \SwaggerServiceMockTrait ;
18+ use RonasIT \AutoDoc \Tests \Support \Traits \SwaggerServiceTestingTrait ;
1819use stdClass ;
1920
2021class SwaggerServiceTest extends TestCase
2122{
22- use SwaggerServiceMockTrait;
23+ use SwaggerServiceMockTrait, SwaggerServiceTestingTrait ;
2324
2425 public function testConstructorInvalidConfigVersion ()
2526 {
Original file line number Diff line number Diff line change @@ -68,18 +68,4 @@ protected function mockDriverSaveData($driverClass = LocalDriver::class): void
6868 $ this ->functionCall ('saveData ' ),
6969 ]);
7070 }
71-
72- protected function fillTempFile (string $ content ): void
73- {
74- file_put_contents (getcwd () . '/storage/temp_documentation.json ' , $ content );
75- }
76-
77- protected function assertTempFileEqualsFixture (string $ fixture ): void
78- {
79- $ fixture = $ this ->prepareFixtureName ($ fixture );
80-
81- $ path = $ this ->generateFixturePath ($ fixture );
82-
83- $ this ->assertFileEquals ($ path , getcwd () . '/storage/temp_documentation.json ' );
84- }
8571}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace RonasIT \AutoDoc \Tests \Support \Traits ;
4+
5+ use RonasIT \Support \Traits \MockTrait ;
6+
7+ trait SwaggerServiceTestingTrait
8+ {
9+ use MockTrait;
10+
11+ protected function fillTempFile (string $ content ): void
12+ {
13+ file_put_contents (getcwd () . '/storage/temp_documentation.json ' , $ content );
14+ }
15+
16+ protected function assertTempFileEqualsFixture (string $ fixture ): void
17+ {
18+ $ fixture = $ this ->prepareFixtureName ($ fixture );
19+
20+ $ path = $ this ->generateFixturePath ($ fixture );
21+
22+ $ this ->assertFileEquals ($ path , getcwd () . '/storage/temp_documentation.json ' );
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments