Esempio n. 1
0
 public function testFetchUser()
 {
     // Create a new foursquare crawler for this instance with the access token fauxaccesstoken
     $fsc = new FoursquareCrawler($this->profile1_instance, 'secret');
     // Fetch this users details from foursquare
     $fsc->fetchUser($this->profile1_instance->network_user_id, $this->profile1_instance->network, true);
     // Get a new user DAO
     $user_dao = new UserMySQLDAO();
     // Get the foursquare users object
     $user = $user_dao->getUserByName('*****@*****.**', 'foursquare');
     // Check that we got something back from the database
     $this->assertTrue(isset($user));
     // Check the username is correct
     $this->assertEqual($user->username, '*****@*****.**');
     // Check the full name is correct
     $this->assertEqual($user->full_name, 'Bob Cats');
     // Check the user ID is correct
     $this->assertEqual($user->user_id, '113612142759476883204');
     // Check the location is correct
     $this->assertEqual($user->location, "Harefield, UK");
     // Check the URL was set correctly
     $this->assertEqual($user->url, 'http://www.foursquare.com/user/113612142759476883204');
     // Check the user isn't protected
     $this->assertFalse($user->is_protected);
 }