description); $tempMinUnit = new Unit($fakeTempMin, $units, $this->description); $tempMaxUnit = new Unit($fakeTempMax, $units, $this->description); $this->temperature = new Temperature($tempNowUnit, $tempMinUnit, $tempMaxUnit); } public function test__toString() { $expectStr = $this->nowTemp; $expectStr .= ' ' . $this->unit; $str = $this->temperature->__toString(); $this->assertSame($expectStr, $str); $this->assertInternalType('string', $str); } public function testGetUnit() { $expectUnit = $this->unit; $unit = $this->temperature->getUnit(); $this->assertSame($expectUnit, $unit); $this->assertInternalType('string', $unit); } public function testGetValue() { $expectValue = round($this->nowTemp, 2); $value = $this->temperature->getValue(); $this->assertSame($expectValue, $value); $this->assertInternalType('double', $value); } public function testGetDescription() { $expectDescription = $this->description; $description = $this->temperature->getDescription(); $this->assertSame($expectDescription, $description); $this->assertInternalType('string', $description); } public function testGetFormatted() { $expectFormattedString = $this->nowTemp; $expectFormattedString .= ' ' . $this->unit; $formattedString = $this->temperature->getFormatted(); $this->assertSame($expectFormattedString, $formattedString); $this->assertInternalType('string', $formattedString); } }