Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Verify2/ClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __invoke(ContainerInterface $container): Client
$api->setIsHAL(false)
->setErrorsOn200(false)
->setAuthHandlers([new KeypairHandler(), new BasicHandler()])
->setBaseUrl('https://api.nexmo.com/v2/verify');
->setBaseUri('/v2/verify');

return new Client($api);
}
Expand Down
4 changes: 3 additions & 1 deletion test/Verify2/ClientFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function testInvokeCreatesClientWithConfiguredApiResource(): void
];

$mockClient = $this->createMock(Client::class);
$mockClient->method('getApiUrl')->willReturn('https://api.nexmo.com');
$container = new MapFactory($mockServices, $mockClient);
$factory = new ClientFactory();

Expand All @@ -29,7 +30,8 @@ public function testInvokeCreatesClientWithConfiguredApiResource(): void
->getAuthHandlers()[0]);
$this->assertInstanceOf(Client\Credentials\Handler\BasicHandler::class, $result->getAPIResource()
->getAuthHandlers()[1]);
$this->assertEquals('https://api.nexmo.com/v2/verify', $result->getAPIResource()->getBaseUrl());
$this->assertEquals('https://api.nexmo.com', $result->getAPIResource()->getBaseUrl());
$this->assertEquals('/v2/verify', $result->getAPIResource()->getBaseUri());
$this->assertFalse($result->getApiResource()->errorsOn200());
$this->assertFalse($result->getApiResource()->isHAL());
}
Expand Down