You are here

public function ShareaholicSeqShareCountsTest::testGooglePlusPrepareRequest 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::testGooglePlusPrepareRequest()

File

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

Class

ShareaholicSeqShareCountsTest

Code

public function testGooglePlusPrepareRequest() {
  $config = ShareaholicSeqShareCount::get_services_config();

  // check that the function sets the post body in the $config object
  $this->share_count
    ->google_plus_prepare_request($this->url, $config);
  $this
    ->assertNotNull($config['google_plus']['body'], 'The post body for google plus should not be null');

  // mock the ip address and check that the userIp is set
  $mockIp = 'mockIp';
  $_SERVER['REMOTE_ADDR'] = $mockIp;
  $this->share_count
    ->google_plus_prepare_request($this->url, $config);
  $this
    ->assertEquals($mockIp, $config['google_plus']['body'][0]['params']['userIp']);
}