| 1 | <?php |
||
| 11 | class AccessTokenTest extends \Test\TestCase |
||
| 12 | { |
||
| 13 | 1 | public function testConstructSuccess() |
|
| 14 | { |
||
| 15 | 1 | $token = new AccessToken('accessToken'); |
|
|
|
|||
| 16 | $this->assertSame('accessToken', $token->getToken()); |
||
| 17 | |||
| 18 | return $token; |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @expectedException \InvalidArgumentException |
||
| 23 | * @expectedExceptionMessage $token must be a string, passed: integer |
||
| 24 | */ |
||
| 25 | 1 | public function testExceptionNotString() |
|
| 29 | } |
||
| 30 |
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: