public function testRequestFactory()
 {
     $configuration = new GenericConfiguration();
     $configuration->setApiKey('12345')->setTrackingKey('trackkey')->setDigitalSign('dummydigitalsign')->setRequest(new Request());
     $request = RequestFactory::createRequest($configuration);
     $this->assertSame($configuration, \PHPUnit_Framework_Assert::readAttribute($request, 'configuration'));
 }
Example #2
0
 public function runOperation(OperationInterface $operation, ConfigurationInterface $configuration = null)
 {
     $configuration = is_null($configuration) ? $this->configuration : $configuration;
     if (true === is_null($configuration)) {
         throw new \Exception('No configuration passed.');
     }
     $requestObject = RequestFactory::createRequest($configuration);
     $response = $requestObject->perform($operation);
     return $this->applyResponseTransformer($response, $configuration);
 }