setAssociateTag() public method

Sets the associatetag
public setAssociateTag ( string $associateTag ) : GenericConfiguration
$associateTag string
return GenericConfiguration
 public function testGettersAndSetters()
 {
     $this->genericConfiguration->setAccessKey('ABC');
     $this->genericConfiguration->setSecretKey('DEF');
     $this->genericConfiguration->setAssociateTag('GHI');
     $this->assertSame('ABC', $this->genericConfiguration->getAccessKey());
     $this->assertSame('DEF', $this->genericConfiguration->getSecretKey());
     $this->assertSame('GHI', $this->genericConfiguration->getAssociateTag());
 }
Ejemplo n.º 2
0
 public function testGettersAndSetters()
 {
     $object = new GenericConfiguration();
     $object->setAccessKey('ABC');
     $object->setSecretKey('DEF');
     $object->setAssociateTag('GHI');
     $object->setResponseTransformer($a = new XmlToDomDocument());
     $object->setRequest($b = new GuzzleRequest($this->prophesize('\\GuzzleHttp\\ClientInterface')->reveal()));
     $this->assertSame('ABC', $object->getAccessKey());
     $this->assertSame('DEF', $object->getSecretKey());
     $this->assertSame('GHI', $object->getAssociateTag());
     $this->assertSame($a, $object->getResponseTransformer());
     $this->assertSame($b, $object->getRequest());
 }
Ejemplo n.º 3
0
 public function testSchemeSwitch()
 {
     $body = $this->prophesize('\\Psr\\Http\\Message\\StreamInterface');
     $body->getContents()->shouldBeCalledTimes(1)->willReturn('ABC');
     $response = $this->prophesize('\\Psr\\Http\\Message\\ResponseInterface');
     $response->getBody()->shouldBeCalledTimes(1)->willReturn($body->reveal());
     $client = $this->prophesize('\\GuzzleHttp\\ClientInterface');
     $client->send(Argument::that(function ($request) {
         if (!$request instanceof RequestInterface) {
             return false;
         }
         $uri = $request->getUri();
         $this->assertSame('https', $uri->getScheme());
         return true;
     }))->shouldBeCalledTimes(1)->willReturn($response->reveal());
     $request = new GuzzleRequest($client->reveal());
     $request->setScheme('HTTPS');
     $operation = new Lookup();
     $operation->setItemId('1');
     $config = new GenericConfiguration();
     $config->setAccessKey('abc');
     $config->setAssociateTag('def');
     $config->setCountry('DE');
     $config->setSecretKey('ghi');
     $config->setAccessKey('jkl');
     $request->perform($operation, $config);
 }