/** * Test that we can extract the values from an instance of Precipitation * * @covers \OpenWeatherMap\Hydrator\Strategy\PrecipitationStrategy::extract */ public function testExtract() { $value = 1; $type = 'snow'; $precipitation = new Precipitation(); $precipitation->setValue($value)->setType($type); $strategy = new PrecipitationStrategy(); $values = $strategy->extract($precipitation); $this->assertArrayHasKey('value', $values); $this->assertArrayHasKey('type', $values); }
/** * Test that attempting to set the value with an object results in an exception * being thrown * * @expectedException InvalidArgumentException * @covers \OpenWeatherMap\Entity\Precipitation::setValue */ public function testSetValueWithObjectThrowsException() { $precipitation = new Precipitation(); $value = new stdClass(); $precipitation->setValue($value); }