public function testFind()
 {
     $region = $this->repository->find(1);
     $this->assertInstanceOf('Wonderland\\Application\\Model\\Region', $region);
     $this->assertEquals(1, $region->getId());
     $this->assertEquals('Île-de-France', $region->getName());
     $this->assertEquals(75.366, $region->getLatitude());
     $this->assertEquals(125.84, $region->getLongitude());
     $this->assertInstanceOf('DateTime', $region->getCreatedAt());
     $country = $region->getCountry();
     $this->assertInstanceOf('Wonderland\\Application\\Model\\Country', $country);
     $this->assertEquals(1, $country->getId());
     $this->assertEquals('fr', $country->getCode());
     $this->assertEquals('countries.france', $country->getLabel());
 }
Exemplo n.º 2
0
 /**
  * @param int $id
  * @return \Wonderland\Application\Model\Region
  */
 public function get($id)
 {
     return $this->repository->find($id);
 }