示例#1
0
 public function getVersion($version)
 {
     $res = $this->getClient()->get($this->getUri($version));
     $v = new Version();
     $v->populate($res->getJson());
     return $v;
 }
示例#2
0
 public function testSetterGetter()
 {
     $v = new Version();
     $v->setId('v2.0');
     $v->setStatus('stable');
     $v->setUpdated('2015-07-01 12:00:00');
     $v->setMediaTypes([]);
     $v->setLinks([TEST_IDENTITY_ENDPOINT]);
     $this->assertEquals('v2.0', $v->getId());
     $this->assertEquals('stable', $v->getStatus());
     $this->assertInstanceOf('\\DateTime', $v->getUpdated());
     $this->assertTrue(is_array($v->getMediaTypes()));
     $this->assertTrue(is_array($v->getLinks()));
 }