Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
fokosun committed Aug 23, 2023
1 parent 437fe69 commit a8c4c05
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 81 deletions.
51 changes: 0 additions & 51 deletions app/Http/Middleware/AuthorizationGuard.php

This file was deleted.

30 changes: 0 additions & 30 deletions app/Http/Middleware/MustVerifyEmail.php

This file was deleted.

21 changes: 21 additions & 0 deletions tests/Unit/Controllers/SearchControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@

class SearchControllerTest extends \TestCase
{
/**
* @test
*/
public function it_validates_search_request_body()
{
$searchController = new SearchController();

$response = $searchController->getSearchResults(new SearchRequest([
'query' => null
]));

$decoded = json_decode($response->getContent(), true);
$this->assertSame([
'errors' => [
'query' => [
'The query field is required.'
]
]
], $decoded);
}

public function test_it_is_instantiable()
{
$searchController = new SearchController();
Expand Down

0 comments on commit a8c4c05

Please sign in to comment.