/**
  * Test that we can extract the values from an instance of Clouds
  *
  * @covers \OpenWeatherMap\Hydrator\Strategy\CloudsStrategy::extract
  */
 public function testExtract()
 {
     $value = 'broken clouds';
     $all = 56;
     $unit = '%';
     $clouds = new Clouds();
     $clouds->setAll($all)->setUnit($unit)->setValue($value);
     $strategy = new CloudsStrategy();
     $values = $strategy->extract($clouds);
     $this->assertArrayHasKey('value', $values);
     $this->assertArrayHasKey('all', $values);
     $this->assertArrayHasKey('unit', $values);
 }
예제 #2
0
 /**
  * Test that we can get and set the unit
  *
  * @covers \OpenWeatherMap\Entity\Clouds::getUnit
  * @covers \OpenWeatherMap\Entity\Clouds::setUnit
  */
 public function testGetSetUnit()
 {
     $clouds = new Clouds();
     $unit = '%';
     $this->assertNull($clouds->getUnit());
     $this->assertSame($clouds, $clouds->setUnit($unit));
     $this->assertEquals($unit, $clouds->getUnit());
 }