| @@ 39-48 (lines=10) @@ | ||
| 36 | $this->temperature = new Temperature($tempNowUnit, $tempMinUnit, $tempMaxUnit); |
|
| 37 | } |
|
| 38 | ||
| 39 | public function test__toString() |
|
| 40 | { |
|
| 41 | $expectStr = $this->nowTemp; |
|
| 42 | $expectStr .= ' ' . $this->unit; |
|
| 43 | $temp = $this->temperature; |
|
| 44 | $str = $temp->__toString(); |
|
| 45 | ||
| 46 | $this->assertSame($expectStr, $str); |
|
| 47 | $this->assertInternalType('string', $str); |
|
| 48 | } |
|
| 49 | ||
| 50 | public function testGetUnit() |
|
| 51 | { |
|
| @@ 50-58 (lines=9) @@ | ||
| 47 | $this->assertInternalType('string', $str); |
|
| 48 | } |
|
| 49 | ||
| 50 | public function testGetUnit() |
|
| 51 | { |
|
| 52 | $expectUnit = $this->unit; |
|
| 53 | $temp = $this->temperature; |
|
| 54 | $unit = $temp->getUnit(); |
|
| 55 | ||
| 56 | $this->assertSame($expectUnit, $unit); |
|
| 57 | $this->assertInternalType('string', $unit); |
|
| 58 | } |
|
| 59 | ||
| 60 | public function testGetValue() |
|
| 61 | { |
|
| @@ 69-77 (lines=9) @@ | ||
| 66 | $this->assertInternalType('double', $value); |
|
| 67 | } |
|
| 68 | ||
| 69 | public function testGetDescription() |
|
| 70 | { |
|
| 71 | $expectDescription = $this->description; |
|
| 72 | $temp = $this->temperature; |
|
| 73 | $description = $temp->getDescription(); |
|
| 74 | ||
| 75 | $this->assertSame($expectDescription, $description); |
|
| 76 | $this->assertInternalType('string', $description); |
|
| 77 | } |
|
| 78 | ||
| 79 | public function testGetFormatted() |
|
| 80 | { |
|
| @@ 79-88 (lines=10) @@ | ||
| 76 | $this->assertInternalType('string', $description); |
|
| 77 | } |
|
| 78 | ||
| 79 | public function testGetFormatted() |
|
| 80 | { |
|
| 81 | $expectFormattedString = $this->nowTemp; |
|
| 82 | $expectFormattedString .= ' ' . $this->unit; |
|
| 83 | $temp = $this->temperature; |
|
| 84 | $formattedString = $temp->getFormatted(); |
|
| 85 | ||
| 86 | $this->assertSame($expectFormattedString, $formattedString); |
|
| 87 | $this->assertInternalType('string', $formattedString); |
|
| 88 | } |
|
| 89 | } |
|
| 90 | ||