-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from RonasIT/67_increase_covering_by_unit_tests
#67: Increase coverage by unit tests
- Loading branch information
Showing
29 changed files
with
1,559 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace RonasIT\Support\Tests; | ||
|
||
use RonasIT\Support\AutoDoc\Http\Middleware\AutoDocMiddleware; | ||
use RonasIT\Support\Tests\Support\Traits\SwaggerServiceMockTrait; | ||
|
||
class AutoDocMiddlewareTest extends TestCase | ||
{ | ||
use SwaggerServiceMockTrait; | ||
|
||
public function testHandle() | ||
{ | ||
config(['auto-doc.security' => 'laravel']); | ||
|
||
$this->mockDriverGetEmptyAndSaveTpmData($this->getJsonFixture('tmp_data_search_roles_request')); | ||
|
||
$request = $this->generateGetRolesRequest(); | ||
|
||
$middleware = new AutoDocMiddleware(); | ||
|
||
$middleware->handle($request, function () { | ||
return $this->generateResponse('example_success_search_roles_response.json'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace RonasIT\Support\Tests; | ||
|
||
class PushDocumentationCommandTest extends TestCase | ||
{ | ||
public function testHandle() | ||
{ | ||
$this->artisan('swagger:push-documentation')->assertExitCode(0); | ||
|
||
$this->assertFileExists(storage_path('documentation.json')); | ||
|
||
$docContent = file_get_contents(storage_path('documentation.json')); | ||
|
||
$this->assertEqualsJsonFixture('documentation', json_decode($docContent, true)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.