Skip to content

Commit 75531c4

Browse files
committed
Make regex request matcher final, improve tests
1 parent 62e9ff4 commit 75531c4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

spec/RequestMatcher/RegexRequestMatcherSpec.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace spec\Http\Message\RequestMatcher;
44

55
use Http\Message\RequestMatcher;
6-
use PhpSpec\ObjectBehavior;
76
use Psr\Http\Message\RequestInterface;
87
use Psr\Http\Message\UriInterface;
8+
use PhpSpec\ObjectBehavior;
99

1010
class RegexRequestMatcherSpec extends ObjectBehavior
1111
{
@@ -14,17 +14,17 @@ function let($regex)
1414
$this->beConstructedWith($regex);
1515
}
1616

17-
function it_is_a_request_matcher()
17+
function it_is_initializable()
1818
{
19-
$this->shouldImplement('Http\Message\RequestMatcher');
19+
$this->shouldHaveType('Http\Message\RequestMatcher\RegexRequestMatcher');
2020
}
2121

22-
function it_is_initializable()
22+
function it_is_a_request_matcher()
2323
{
24-
$this->shouldHaveType('Http\Message\RequestMatcher\RegexRequestMatcher');
24+
$this->shouldImplement('Http\Message\RequestMatcher');
2525
}
2626

27-
function it_matches(RequestInterface $request, UriInterface $uri)
27+
function it_matches_a_request(RequestInterface $request, UriInterface $uri)
2828
{
2929
$this->beConstructedWith('/test/');
3030

@@ -34,7 +34,7 @@ function it_matches(RequestInterface $request, UriInterface $uri)
3434
$this->matches($request)->shouldReturn(true);
3535
}
3636

37-
function it_does_not_match(RequestInterface $request, UriInterface $uri)
37+
function it_does_not_match_a_request(RequestInterface $request, UriInterface $uri)
3838
{
3939
$this->beConstructedWith('/test/');
4040

src/RequestMatcher/RegexRequestMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @author Joel Wurtz <[email protected]>
1212
*/
13-
class RegexRequestMatcher implements RequestMatcher
13+
final class RegexRequestMatcher implements RequestMatcher
1414
{
1515
/**
1616
* Matching regex.

0 commit comments

Comments
 (0)