| @@ 44-64 (lines=21) @@ | ||
| 41 | ->isTrue(); |
|
| 42 | } |
|
| 43 | ||
| 44 | public function testDisallow() |
|
| 45 | { |
|
| 46 | $this |
|
| 47 | ->given( |
|
| 48 | $sut = new SUT(''), |
|
| 49 | $sut->disallow('/foo/bar'), |
|
| 50 | $sut->allow('/foo/bar/baz$') |
|
| 51 | ) |
|
| 52 | ->when($match = $sut->match('/foo/bar')) |
|
| 53 | ->then |
|
| 54 | ->boolean($match) |
|
| 55 | ->isFalse() |
|
| 56 | ->when($match = $sut->match('/foo/bar/baz/')) |
|
| 57 | ->then |
|
| 58 | ->boolean($match) |
|
| 59 | ->isFalse() |
|
| 60 | ->when($match = $sut->match('/foo/bar/baz')) |
|
| 61 | ->then |
|
| 62 | ->boolean($match) |
|
| 63 | ->isTrue(); |
|
| 64 | } |
|
| 65 | ||
| 66 | public function testUserAgent() |
|
| 67 | { |
|
| @@ 75-96 (lines=22) @@ | ||
| 72 | ->isEqualTo('UA'); |
|
| 73 | } |
|
| 74 | ||
| 75 | public function testMultipleExpression() |
|
| 76 | { |
|
| 77 | $this |
|
| 78 | ->given( |
|
| 79 | $sut = new SUT(''), |
|
| 80 | $sut->disallow('/foo/bar'), |
|
| 81 | $sut->allow('/foo/bar/baz$'), |
|
| 82 | $sut->allow('/foo$') |
|
| 83 | ) |
|
| 84 | ->when($match = $sut->match('/foo/bar')) |
|
| 85 | ->then |
|
| 86 | ->boolean($match) |
|
| 87 | ->isFalse() |
|
| 88 | ->when($match = $sut->match('/foo/bar/baz/')) |
|
| 89 | ->then |
|
| 90 | ->boolean($match) |
|
| 91 | ->isFalse() |
|
| 92 | ->when($match = $sut->match('/foo/bar/baz')) |
|
| 93 | ->then |
|
| 94 | ->boolean($match) |
|
| 95 | ->isTrue(); |
|
| 96 | } |
|
| 97 | } |
|
| 98 | ||