Conditions | 1 |
Paths | 1 |
Total Lines | 47 |
Code Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
42 | public function testIndexWithIndexAndType() |
||
43 | { |
||
44 | $provider = $this->getMockForAbstractClass(DataProvider::class); |
||
45 | |||
46 | $client = $this->getClient(); |
||
47 | $client |
||
48 | ->expects($this->once()) |
||
49 | ->method('bulk') |
||
50 | ->with([ |
||
51 | 'body' => |
||
52 | [ |
||
53 | [ |
||
54 | 'index' => [ |
||
55 | '_index' => 'my_index', |
||
56 | '_type' => 'my_type', |
||
57 | '_id' => 'my_id', |
||
58 | ] |
||
59 | ], |
||
60 | [ |
||
61 | 'foo' => 'bar', |
||
62 | ] |
||
63 | ] |
||
64 | ] |
||
65 | ); |
||
66 | |||
67 | $provider |
||
68 | ->expects($this->once()) |
||
69 | ->method('populate') |
||
70 | ->will( |
||
71 | $this->returnCallback( |
||
72 | function () use ($provider) { |
||
73 | $provider->index( |
||
74 | 'my_id', |
||
75 | ['foo' => 'bar'] |
||
76 | ); |
||
77 | } |
||
78 | ) |
||
79 | ) |
||
80 | ; |
||
81 | |||
82 | $provider->run( |
||
83 | $client, |
||
84 | 'my_index', |
||
85 | 'my_type', |
||
86 | $this->getMock(EventDispatcherInterface::class) |
||
87 | ); |
||
88 | } |
||
89 | |||
124 | } |
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.