Inheritance: implements PayPal\Handler\IPPHandler
 /**
  * @test
  */
 public function testHeadersAddedForSOAP()
 {
     $options = array('config' => array('mode' => 'sandbox'), 'serviceName' => 'AdaptivePayments', 'apiMethod' => 'ConvertCurrency');
     $req = new PPRequest(new StdClass(), 'SOAP');
     $handler = new PPSignatureAuthHandler();
     // Test that no headers are added if no credential is passed
     $httpConfig = new PPHttpConfig();
     $handler->handle($httpConfig, $req, $options);
     $this->assertEquals('', $req->getBindingInfo('securityHeader'));
     // Test that the 3 token SOAP headers are added for first party API calls
     $req = new PPRequest(new StdClass(), 'SOAP');
     $req->setCredential(new PPSignatureCredential('user', 'pass', 'sign'));
     $handler->handle($httpConfig, $req, $options);
     $this->assertContains('<ebl:Username>', $req->getBindingInfo('securityHeader'));
     $this->assertContains('<ebl:Password>', $req->getBindingInfo('securityHeader'));
     $this->assertContains('<ebl:Signature>', $req->getBindingInfo('securityHeader'));
     // Test addition of 'subject' SOAP header for subject based third party auth
     $req = new PPRequest(new StdClass(), 'SOAP');
     $cred = new PPSignatureCredential('user', 'pass', 'sign');
     $cred->setThirdPartyAuthorization(new PPSubjectAuthorization('*****@*****.**'));
     $req->setCredential($cred);
     $handler->handle($httpConfig, $req, $options);
     $this->assertContains('<ebl:Username>', $req->getBindingInfo('securityHeader'));
     $this->assertContains('<ebl:Password>', $req->getBindingInfo('securityHeader'));
     $this->assertContains('<ebl:Signature>', $req->getBindingInfo('securityHeader'));
     $this->assertContains('<ebl:Subject>', $req->getBindingInfo('securityHeader'));
     // Test that no auth related HTTP headers (username, password, sign?) are
     // added for token based third party auth
     $req->getCredential()->setThirdPartyAuthorization(new PPTokenAuthorization('token', 'tokenSecret'));
     $handler->handle($httpConfig, $req, $options);
     $this->assertContains('<ns:RequesterCredentials/>', $req->getBindingInfo('securityHeader'));
     $this->assertEquals(0, count($httpConfig->getHeaders()));
 }