Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Lines | 15 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
26 | View Code Duplication | public function testSetIdentifier() |
|
27 | { |
||
28 | /** @var Clients $clients */ |
||
29 | $clients = \Mockery::mock(Clients::class)->makePartial(); |
||
30 | $clients->shouldReceive('getFields')->andReturn(['id', 'identifier', 'secret']); |
||
31 | $clients->shouldReceive('getPrimaryKey')->andReturn('id'); |
||
32 | $clients->shouldReceive('getModel')->andReturn(Client::class); |
||
33 | |||
34 | $client = $clients->getNew(); |
||
35 | $identifier = $client->getIdentifier(); |
||
36 | self::assertGreaterThan(30, strlen($identifier)); |
||
37 | |||
38 | $data = $clients->getQueryModelData($client); |
||
39 | self::assertArrayHasKey('identifier', $data); |
||
40 | } |
||
41 | } |
||
42 |
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: