Skip to content

Commit 443ec9f

Browse files
committed
Merge pull request #57 from php-http/spl_exceptions
Make custom SPL exception extensions final
2 parents 26c9257 + 4248e36 commit 443ec9f

15 files changed

+37
-16
lines changed

spec/Exception/BatchExceptionSpec.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ function it_is_initializable()
1414
$this->shouldHaveType('Http\Client\Exception\BatchException');
1515
}
1616

17+
function it_is_a_runtime_exception()
18+
{
19+
$this->shouldHaveType('RuntimeException');
20+
}
21+
1722
function it_is_an_exception()
1823
{
1924
$this->shouldImplement('Http\Client\Exception');
20-
$this->shouldHaveType('Exception');
2125
}
2226

2327
function it_has_a_result()

spec/Exception/ClientExceptionSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function it_is_initializable()
2020
$this->shouldHaveType('Http\Client\Exception\ClientException');
2121
}
2222

23-
function it_is_http_exception()
23+
function it_is_an_http_exception()
2424
{
2525
$this->shouldHaveType('Http\Client\Exception\HttpException');
2626
}

spec/Exception/HttpExceptionSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function it_is_initializable()
2020
$this->shouldHaveType('Http\Client\Exception\HttpException');
2121
}
2222

23-
function it_is_request_exception()
23+
function it_is_a_request_exception()
2424
{
2525
$this->shouldHaveType('Http\Client\Exception\RequestException');
2626
}

spec/Exception/InvalidArgumentExceptionSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ function it_is_initializable()
1111
$this->shouldHaveType('Http\Client\Exception\InvalidArgumentException');
1212
}
1313

14-
function it_is_invalid_argument_exception()
14+
function it_is_an_invalid_argument_exception()
1515
{
1616
$this->shouldHaveType('InvalidArgumentException');
1717
}
1818

19-
function it_is_exception()
19+
function it_is_an_exception()
2020
{
2121
$this->shouldImplement('Http\Client\Exception');
2222
}

spec/Exception/NetworkExceptionSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function it_is_initializable()
1717
$this->shouldHaveType('Http\Client\Exception\NetworkException');
1818
}
1919

20-
function it_is_request_exception()
20+
function it_is_a_request_exception()
2121
{
2222
$this->shouldHaveType('Http\Client\Exception\RequestException');
2323
}

spec/Exception/RequestExceptionSpec.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ function it_is_initializable()
1818
$this->shouldHaveType('Http\Client\Exception\RequestException');
1919
}
2020

21+
function it_is_a_transfer_exception()
22+
{
23+
$this->shouldHaveType('Http\Client\Exception\TransferException');
24+
}
25+
2126
function it_has_a_request(RequestInterface $request)
2227
{
2328
$this->getRequest()->shouldReturn($request);

spec/Exception/RuntimeExceptionSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ function it_is_initializable()
1111
$this->shouldHaveType('Http\Client\Exception\RuntimeException');
1212
}
1313

14-
function it_is_runtime_exception()
14+
function it_is_a_runtime_exception()
1515
{
1616
$this->shouldHaveType('RuntimeException');
1717
}
1818

19-
function it_is_exception()
19+
function it_is_an_exception()
2020
{
2121
$this->shouldImplement('Http\Client\Exception');
2222
}

spec/Exception/ServerExceptionSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function it_is_initializable()
2020
$this->shouldHaveType('Http\Client\Exception\ServerException');
2121
}
2222

23-
function it_is_http_exception()
23+
function it_is_an_http_exception()
2424
{
2525
$this->shouldHaveType('Http\Client\Exception\HttpException');
2626
}

spec/Exception/TransferExceptionSpec.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,14 @@ function it_is_initializable()
1111
{
1212
$this->shouldHaveType('Http\Client\Exception\TransferException');
1313
}
14+
15+
function it_is_a_runtime_exception()
16+
{
17+
$this->shouldHaveType('RuntimeException');
18+
}
19+
20+
function it_is_an_exception()
21+
{
22+
$this->shouldImplement('Http\Client\Exception');
23+
}
1424
}

spec/Exception/UnexpectedValueExceptionSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ function it_is_initializable()
1111
$this->shouldHaveType('Http\Client\Exception\UnexpectedValueException');
1212
}
1313

14-
function it_is_invalid_argument_exception()
14+
function it_is_an_unexpected_value_exception()
1515
{
1616
$this->shouldHaveType('UnexpectedValueException');
1717
}
1818

19-
function it_is_exception()
19+
function it_is_an_exception()
2020
{
2121
$this->shouldImplement('Http\Client\Exception');
2222
}

0 commit comments

Comments
 (0)