Skip to content

Commit 71c4759

Browse files
new start
1 parent 8078ec0 commit 71c4759

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/Setup.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php declare(strict_types=1);
2+
3+
use PHPUnit\Framework\Attributes\CoversClass;
4+
use PHPUnit\Framework\Attributes\Test;
5+
use PHPUnit\Framework\TestCase;
6+
use Supabase\Client;
7+
8+
#[CoversClass(Client::class)]
9+
class Setup extends TestCase
10+
{
11+
#[Test]
12+
public function testConstructorSetsUrlAndApiKey(): void
13+
{
14+
$url = 'https://test.supabase.io';
15+
$apiKey = 'test-api-key';
16+
17+
$client = new Client($url, $apiKey);
18+
19+
$urlProp = new \ReflectionProperty(Client::class, 'url');
20+
$urlProp->setAccessible(true);
21+
22+
$apiKeyProp = new \ReflectionProperty(Client::class, 'apiKey');
23+
$apiKeyProp->setAccessible(true);
24+
25+
$this->assertEquals($url, $urlProp->getValue($client));
26+
$this->assertEquals($apiKey, $apiKeyProp->getValue($client));
27+
}
28+
}

0 commit comments

Comments
 (0)