Conditions | 1 |
Paths | 1 |
Total Lines | 33 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | public function testIndexWithIndexAndType() |
||
37 | { |
||
38 | $provider = $this->getMockForAbstractClass(DataProvider::class); |
||
39 | |||
40 | $client = $this->getClient(); |
||
41 | $client |
||
42 | ->expects($this->once()) |
||
43 | ->method('index') |
||
44 | ->with([ |
||
45 | 'index' => 'my_index', |
||
46 | 'type' => 'my_type', |
||
47 | 'id' => 'my_id', |
||
48 | 'body' => ['foo' => 'bar'], |
||
49 | ]) |
||
50 | ; |
||
51 | |||
52 | $provider |
||
53 | ->expects($this->once()) |
||
54 | ->method('populate') |
||
55 | ->will( |
||
56 | $this->returnCallback( |
||
57 | function () use ($provider) { |
||
58 | $provider->index( |
||
59 | 'my_id', |
||
60 | ['foo' => 'bar'] |
||
61 | ); |
||
62 | } |
||
63 | ) |
||
64 | ) |
||
65 | ; |
||
66 | |||
67 | $provider->run($client, 'my_index', 'my_type'); |
||
68 | } |
||
69 | } |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.