| 1 | <?php |
||
| 10 | final class UrlTest extends TestCase |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @test |
||
| 14 | * @covers ::filter |
||
| 15 | */ |
||
| 16 | public function filter() |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @test |
||
| 24 | * @expectedException \TraderInteractive\Filter\Exception |
||
| 25 | * @expectedExceptionMessage Value '1' is not a string |
||
| 26 | * @covers ::filter |
||
| 27 | */ |
||
| 28 | public function filterNonstring() |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @test |
||
| 35 | * @expectedException \TraderInteractive\Filter\Exception |
||
| 36 | * @expectedExceptionMessage Value 'www.example.com' is not a valid url |
||
| 37 | * @covers ::filter |
||
| 38 | */ |
||
| 39 | public function filterNotValid() |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @test |
||
| 46 | * @covers ::filter |
||
| 47 | */ |
||
| 48 | public function filterNullPass() |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @test |
||
| 55 | * @expectedException Exception |
||
| 56 | * @expectedExceptionMessage Value 'NULL' is not a string |
||
| 57 | * @covers ::filter |
||
| 58 | */ |
||
| 59 | public function filterNullFail() |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @test |
||
| 66 | * @expectedException InvalidArgumentException |
||
| 67 | * @expectedExceptionMessage $allowNull was not a boolean value |
||
| 68 | * @covers ::filter |
||
| 69 | */ |
||
| 70 | public function filterAllowNullNotBoolean() |
||
| 74 | } |
||
| 75 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: