/** * @test */ public function testCustomEndpoint() { $customEndpoint = 'http://mydomain'; $httpConfig = new PPHttpConfig(); $apiContext = new PPApiContext(array('service.EndPoint' => $customEndpoint, 'acct1.ClientId' => 'clientId', 'acct1.ClientSecret' => 'clientSecret')); $handler = new PPOpenIdHandler(); $handler->handle($httpConfig, 'payload', array('path' => '/path', 'apiContext' => $apiContext)); $this->assertEquals("{$customEndpoint}/path", $httpConfig->getUrl()); $customEndpoint = 'http://mydomain/'; $httpConfig = new PPHttpConfig(); $apiContext = new PPApiContext(array('service.EndPoint' => $customEndpoint, 'acct1.ClientId' => 'clientId', 'acct1.ClientSecret' => 'clientSecret')); $handler = new PPOpenIdHandler(); $handler->handle($httpConfig, 'payload', array('path' => '/path', 'apiContext' => $apiContext)); $this->assertEquals("{$customEndpoint}path", $httpConfig->getUrl()); $customEndpoint = 'http://mydomain'; $httpConfig = new PPHttpConfig(); $apiContext = new PPApiContext(array('service.EndPoint' => 'xyz', 'openid.EndPoint' => $customEndpoint, 'acct1.ClientId' => 'clientId', 'acct1.ClientSecret' => 'clientSecret')); $handler = new PPOpenIdHandler(); $handler->handle($httpConfig, 'payload', array('path' => '/path', 'apiContext' => $apiContext)); $this->assertEquals("{$customEndpoint}/path", $httpConfig->getUrl()); }