You are here

public function ShareaholicSeqShareCountsTest::testStumbleuponCountCallback in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.3

Same name and namespace in other branches
  1. 8 lib/social-share-counts/seq_share_count_test.php \ShareaholicSeqShareCountsTest::testStumbleuponCountCallback()

File

lib/social-share-counts/seq_share_count_test.php, line 123

Class

ShareaholicSeqShareCountsTest

Code

public function testStumbleuponCountCallback() {

  // given a typical stumbleupon counts api response, test that
  // it gives back the expected result (the views which is 1)
  $body = '{"result":{"url":"https:\\/\\/blog.shareaholic.com\\/","in_index":true,"publicid":"1Qat7p","views":1,"title":"Blog \\/ Shareaholic (@shareaholic)","thumbnail":"http:\\/\\/cdn.stumble-upon.com\\/mthumb\\/672\\/157433672.jpg","thumbnail_b":"http:\\/\\/cdn.stumble-upon.com\\/bthumb\\/672\\/157433672.jpg","submit_link":"http:\\/\\/www.stumbleupon.com\\/submit\\/?url=https:\\/\\/blog.shareaholic.com\\/","badge_link":"http:\\/\\/www.stumbleupon.com\\/badge\\/?url=https:\\/\\/blog.shareaholic.com\\/","info_link":"http:\\/\\/www.stumbleupon.com\\/url\\/https%253A\\/\\/blog.shareaholic.com\\/"},"timestamp":1394771877,"success":true}';
  $this->response['body'] = $body;
  $count = $this->share_count
    ->stumbleupon_count_callback($this->response);
  $this
    ->assertEquals(1, $count, 'It should get the correct stumbleupon count');
}