File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments