| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function testReturnsZeroWheneverApiProvideEmptyResponse() |
||
| 10 | { |
||
| 11 | $this->apiCaller = $this |
||
|
|
|||
| 12 | ->getMockBuilder('CurrencyConverter\ApiCaller') |
||
| 13 | ->disableOriginalConstructor() |
||
| 14 | ->getMock(); |
||
| 15 | |||
| 16 | $this->rates = new Rates($this->apiCaller); |
||
| 17 | |||
| 18 | $this->apiCaller->expects($this->once()) |
||
| 19 | ->method('convert') |
||
| 20 | ->with('FOO', 'BAR'); |
||
| 21 | |||
| 22 | $this->apiCaller->expects($this->once()) |
||
| 23 | ->method('isLastCallEmpty') |
||
| 24 | ->willReturn(true); |
||
| 25 | |||
| 26 | $result = $this->rates->getRates('FOO', 'BAR'); |
||
| 27 | |||
| 28 | $this->assertEquals(0, $result); |
||
| 29 | } |
||
| 30 | |||
| 61 |
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: