Пример #1
0
 public function testParseProfile()
 {
     // Replace parseProfile with static data
     $this->habboParserMock->expects($this->once())->method('_callUrl')->will($this->returnValue(self::$profile));
     $profile = $this->habboParserMock->parseProfile('hhus-9cd61b156972c2eb33a145d69918f965');
     $this->assertInstanceOf('HabboAPI\\Entities\\Habbo', $profile['habbo']);
     $this->assertInstanceOf('HabboAPI\\Entities\\Habbo', $profile['friends'][0]);
     $this->assertInstanceOf('HabboAPI\\Entities\\Group', $profile['groups'][0]);
     $this->assertInstanceOf('HabboAPI\\Entities\\Room', $profile['rooms'][0]);
     $this->assertInstanceOf('HabboAPI\\Entities\\Badge', $profile['badges'][0]);
 }
Пример #2
0
 public function testParseProfile()
 {
     // Replace parseProfile with static data
     $this->habboParserMock->expects($this->once())->method('_callUrl')->will($this->returnValue(array(self::$profile)));
     /** @var Profile $profile */
     $profile = $this->habboParserMock->parseProfile('hhus-9cd61b156972c2eb33a145d69918f965');
     $friends = $profile->getFriends();
     $groups = $profile->getGroups();
     $rooms = $profile->getRooms();
     $badges = $profile->getBadges();
     $this->assertInstanceOf('HabboAPI\\Entities\\Profile', $profile);
     $this->assertInstanceOf('HabboAPI\\Entities\\Habbo', $profile->getHabbo());
     $this->assertInstanceOf('HabboAPI\\Entities\\Habbo', $friends[0]);
     $this->assertInstanceOf('HabboAPI\\Entities\\Group', $groups[0]);
     $this->assertInstanceOf('HabboAPI\\Entities\\Room', $rooms[0]);
     $this->assertInstanceOf('HabboAPI\\Entities\\Badge', $badges[0]);
 }
Пример #3
0
 /** Based on a unique ID, get a full Habbo profile object
  *
  * @param string $id The unique ID Habbo uses for their api. Starts with "hh<country code>-" (i.e. "hhus-")
  * @return Profile
  */
 public function getProfile($id)
 {
     return $this->parser->parseProfile($id);
 }