Skip to content

Commit 4251f6e

Browse files
committed
test: Default configuration test
1 parent df2e1f2 commit 4251f6e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/Unit/GrokConfigTest.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@ class GrokConfigTest extends TestCase
1010
{
1111
public function test_it_uses_default_values_when_not_overridden()
1212
{
13-
// soon ...
13+
$config = new GrokConfig(apiKey: 'test-api-key');
14+
15+
$this->assertEquals('test-api-key', $config->apiKey);
16+
$this->assertEquals(DefaultConfig::BASE_URI->value, $config->baseUri);
17+
$this->assertEquals((int) DefaultConfig::TIMEOUT->value, $config->timeout);
18+
}
19+
20+
public function test_it_allows_custom_values()
21+
{
22+
$customBaseUri = 'https://custom-api.grok.dev';
23+
24+
$config = new GrokConfig(
25+
apiKey: 'test-api-key',
26+
baseUri: $customBaseUri,
27+
);
28+
29+
$this->assertEquals('test-api-key', $config->apiKey);
30+
$this->assertEquals($customBaseUri, $config->baseUri);
1431
}
1532
}

0 commit comments

Comments
 (0)