Skip to content

Commit a53be2b

Browse files
committed
[SOAP-13] Create missing InvalidConfigurationException tests
1 parent cff8e4a commit a53be2b

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ script:
1313
after_script:
1414
- mkdir -p build/logs
1515
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
16-
- php vendor/bin/coveralls -v
16+
- vendor/bin/php-coveralls --exclude-no-stmt -v
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace Tests\Exceptions;
4+
5+
use Tests\TestCase;
6+
use Symfony\Component\HttpFoundation\Response;
7+
use SoapBox\SignedRequests\Exceptions\InvalidConfigurationException;
8+
9+
class InvalidConfigurationExceptionTest extends TestCase
10+
{
11+
/**
12+
* @test
13+
*/
14+
public function an_invalid_configuration_exception_is_constructed_with_a_default_message()
15+
{
16+
$exception = new InvalidConfigurationException();
17+
$this->assertEquals(InvalidConfigurationException::MESSAGE, $exception->getMessage());
18+
}
19+
20+
/**
21+
* @test
22+
*/
23+
public function the_message_for_the_exception_can_be_overwritten_during_construction()
24+
{
25+
$message = "So broken";
26+
$exception = new InvalidConfigurationException($message);
27+
$this->assertNotEquals(InvalidConfigurationException::MESSAGE, $exception->getMessage());
28+
$this->assertEquals($message, $exception->getMessage());
29+
}
30+
31+
/**
32+
* @test
33+
*/
34+
public function it_returns_a_bad_request_status_code()
35+
{
36+
$exception = new InvalidConfigurationException();
37+
$this->assertEquals(Response::HTTP_UNPROCESSABLE_ENTITY, $exception->getStatusCode());
38+
}
39+
40+
/**
41+
* @test
42+
*/
43+
public function it_returns_an_empty_set_of_response_headers()
44+
{
45+
$exception = new InvalidConfigurationException();
46+
$this->assertEmpty($exception->getHeaders());
47+
}
48+
}

0 commit comments

Comments
 (0)