File tree Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,4 @@ script:
13
13
after_script :
14
14
- mkdir -p build/logs
15
15
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
16
- - php vendor/bin/coveralls -v
16
+ - vendor/bin/php- coveralls --exclude-no-stmt -v
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments