Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function testFinish() |
||
30 | { |
||
31 | $this->reflection->setValue($this->writer, [ |
||
32 | ['foo' => 'bar'] |
||
33 | ]); |
||
34 | |||
35 | $this->client->bulk([ |
||
36 | '_index' => 'foo', |
||
37 | 'body' => [[ |
||
38 | 'foo' => 'bar' |
||
39 | ]] |
||
40 | ])->shouldBeCalled(); |
||
41 | |||
42 | $this->writer->finish(); |
||
43 | |||
44 | $this->assertCount(0, $this->reflection->getValue($this->writer)); |
||
45 | } |
||
46 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: