public function testSeePostOnFacebookWithAttachedPlace() { // precondition #1: I have facebook user $this->module->haveFacebookTestUserAccount(); // precondition #2: I have published the post with place attached $params = array('place' => '141971499276483'); $this->facebook->api('me/feed', 'POST', $params); // assert that post was published in the facebook and place is the same $this->module->seePostOnFacebookWithAttachedPlace($params['place']); }
/** * * Please, note that you must have publish_stream permission to be able to publish to user's feed. * * @param string $placeId Place identifier to be verified against user published posts */ public function seePostOnFacebookWithAttachedPlace($placeId) { $posts = $this->facebook->getLastPostsForTestUser(); if ($posts['data']) { foreach ($posts['data'] as $post) { if (array_key_exists('place', $post) && $post['place']['id'] == $placeId) { return; // success } } } $this->fail('Failed to see post on Facebook with attached place with id ' . $placeId); }