Ejemplo n.º 1
0
 public function testGenerateWithoutData()
 {
     try {
         CategoryFactory::generate(null);
     } catch (ChegamosException $e) {
         $this->assertEquals("Parâmetro passado não é um objeto.", $e->getMessage());
         return;
     }
     $this->fail('An expected exception has not been raised.');
 }
Ejemplo n.º 2
0
 private static function populatePlaceWhenIsAPlaceListOrFullPlace($place)
 {
     if (self::isPlaceListOrFullPlace()) {
         $place->setName(self::$placeJsonObject->name);
         $place->setAverageRating(self::$placeJsonObject->average_rating);
         $place->setReviewCount(self::$placeJsonObject->review_count);
         $place->setAddress(new Address(self::$placeJsonObject->address));
         $place->setPoint(PointFactory::generate(self::$placeJsonObject->point));
         $place->setMainUrl(self::$placeJsonObject->main_url);
         $place->setOtherUrl(self::$placeJsonObject->other_url);
         $place->setIconUrl(self::$placeJsonObject->icon_url);
         $place->setCategory(CategoryFactory::generate(self::$placeJsonObject->category));
         $place->setPhone(PhoneFactory::generate(self::$placeJsonObject->phone));
     }
 }