public function setUp()
 {
     $this->savedCustomerKey = Traackr\TraackrApi::getCustomerKey();
     // Try to remove all existing tags
     // when run with @read-ony group this APi call might not be allowed
     // so cactch expcetion and ignore
     try {
         // remove all tags
         Traackr\Influencers::tagRemove(array('tags' => array($this->infTag, $this->infTag2, $this->infTagUTF8), 'all' => true));
     } catch (Traackr\TraackrApiException $e) {
         // Ignore
     }
     // Ensure output is PHP by default
     Traackr\TraackrApi::setJsonOutput(false);
 }
 /**
  * Tests that the same topLinks information is returned when looking up links for
  * influencers by tags or by influencer uids
  */
 public function testParams()
 {
     // Add Tags
     $tagAddParams = array('influencers' => array($this->infUid, $this->infUid2), 'tags' => array($this->testTag));
     Traackr\Influencers::tagAdd($tagAddParams);
     $infs = array($this->infUid, $this->infUid2);
     $tags = array($this->testTag);
     // First test that we have top links to compare
     $posts = Traackr\Analysis::toplinks(array('influencers' => $infs, 'count' => 1));
     # 1 post
     $this->assertCount(1, $posts['links']);
     #just 1 post see above
     $this->assertTrue(in_array($posts['links'][0]['linkbacks'][0]['influencer_uid'], $infs));
     Traackr\TraackrApi::setJsonOutput(true);
     $posts1 = Traackr\Analysis::toplinks(array('influencers' => $infs));
     $posts2 = Traackr\Analysis::toplinks(array('tags' => $tags));
     $this->assertJsonStringEqualsJsonString($posts1, $posts2);
     // Remove Tags
     $tagRemoveParams = array('all' => true, 'tags' => array($this->testTag));
     Traackr\Influencers::tagRemove($tagRemoveParams);
 }
Beispiel #3
0
 public function setUp()
 {
     $this->savedCustomerKey = Traackr\TraackrApi::getCustomerKey();
     // Ensure outout is PHP by default
     Traackr\TraackrApi::setJsonOutput(false);
 }