-
Notifications
You must be signed in to change notification settings - Fork 9
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 #8 from Landerstraeten/add-additional-problems
Add additional problems
- Loading branch information
Showing
15 changed files
with
632 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\Phpro\ApiProblem\Http; | ||
|
||
use Phpro\ApiProblem\Http\HttpApiProblem; | ||
use Phpro\ApiProblem\Http\IAmATeapotProblem; | ||
use PhpSpec\ObjectBehavior; | ||
|
||
class IAmATeapotProblemSpec extends ObjectBehavior | ||
{ | ||
public function let(): void | ||
{ | ||
$this->beConstructedWith('i am a teapot'); | ||
} | ||
|
||
public function it_is_initializable(): void | ||
{ | ||
$this->shouldHaveType(IAmATeapotProblem::class); | ||
} | ||
|
||
public function it_is_an_http_api_problem(): void | ||
{ | ||
$this->shouldHaveType(HttpApiProblem::class); | ||
} | ||
|
||
public function it_can_parse_to_array(): void | ||
{ | ||
$this->toArray()->shouldBe([ | ||
'status' => 418, | ||
'type' => HttpApiProblem::TYPE_HTTP_RFC, | ||
'title' => HttpApiProblem::getTitleForStatusCode(418), | ||
'detail' => 'i am a teapot', | ||
]); | ||
} | ||
} |
Oops, something went wrong.