Skip to content

Commit

Permalink
Update LibrariesIOTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsizemore committed Jul 1, 2024
1 parent 0e4442b commit f6f84b6
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion tests/src/LibrariesIOTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public function testClientError(): void
$mockClient->platform();
}

public function testEndpointParametersInvalidEndpoint(): void
{
$this->expectException(InvalidEndpointException::class);
Utils::endpointParameters('notvalid', '', []);
}

#[TestDox('Providing an invalid API key results in an InvalidApiKeyException')]
public function testInvalidApiKey(): void
{
Expand Down Expand Up @@ -115,6 +121,23 @@ public function testPlatform(): void
self::assertSame('{"Hello":"World"}', $response->getBody()->getContents());
}

/**
* Test the processClientOptions function. It should remove:
* 'base_uri', 'handler', 'http_errors', 'query'
*/
public function testProcessClientOptions(): void
{
$reflection = new \ReflectionMethod('\Esi\LibrariesIO\AbstractClient::processClientOptions');
$result = $reflection->invoke(null, [
'base_uri' => 'local.host',
'handler' => null,
'http_errors' => true,
'query' => [],
'test' => false,
]);
self::assertSame(['test' => false], $result);
}

/**
* @param array<string, int|string> $options
*/
Expand Down Expand Up @@ -341,7 +364,7 @@ public function testUserInvalidOptions(): void
}

/**
* Test the Utils::validateCachePath() with valid and invalid $cachePath's
* Test the Utils::validateCachePath() with valid and invalid $cachePath's.
*/
#[DataProvider('dataCachePathProvider')]
public function testValidateCachePathReturnValues(?string $expected, ?string $cachePath): void
Expand Down

0 comments on commit f6f84b6

Please sign in to comment.