Example #1
0
 public function testLoadFromJson2()
 {
     $o = new Response(file_get_contents(__DIR__ . '/response.2.json'));
     $now = $o->getCondition();
     $this->assertEquals(27, $now->weather->getCode());
     $this->assertEquals('Mostly Cloudy', $now->weather->getEnglishText());
     $this->assertEquals(48, $now->temp->getAsFahrenheit());
     $this->assertEquals(1424867340, $now->updatedAt->getTimestamp());
     $tomorrow = $o->getTomorrow();
     $this->assertEquals(12, $tomorrow->weather->getCode());
     $this->assertEquals('Rain', $tomorrow->weather->getEnglishText());
     $this->assertEquals(48, $tomorrow->tempHigh->getAsFahrenheit());
     $this->assertEquals(42, $tomorrow->tempLow->getAsFahrenheit());
     $at = $o->getUpdatedAt();
     $this->assertEquals(1424867340, $at->getTimestamp());
 }