Esempio n. 1
0
 /**
  * @covers aRvi\Client\ClientFactory::getClient
  */
 public function testGetClientWithInvalidData()
 {
     $_SERVER = array("REMOTE_ADDR" => "not-an-ip", "HTTP_X_FORWARDED_FOR" => "192.168.0.1");
     $client = ClientFactory::getClient();
     $this->assertAttributeEquals(null, "strIpAddress", $client);
     $this->assertAttributeEquals(null, "strRealIpAddress", $client);
 }
 public function showMerchant($id)
 {
     define('API', 'PS');
     require_once 'siteadmin/includes/config/affiliatewindow.php';
     require_once 'siteadmin/includes/libs/affiliatewindow/class.ClientFactory.php';
     $oClient = ClientFactory::getClient(API_USERNAME, API_PASSWORD, API_USER_TYPE);
     $listmerchants = array('iMerchantId' => $id, 'sColumnToReturn' => array('sStrapline', 'sDescription', 'sLogoUrl', 'sDisplayUrl', 'sClickThroughUrl', 'oDiscountCode', 'oCommissionRange'));
     $oResponse = $oClient->call('getMerchant', $listmerchants);
 }