File tree Expand file tree Collapse file tree 12 files changed +90
-79
lines changed Expand file tree Collapse file tree 12 files changed +90
-79
lines changed Original file line number Diff line number Diff line change @@ -43,3 +43,4 @@ composer.lock export-ignore
4343.editorconfig export-ignore
4444.env.example export-ignore
4545LICENSE export-ignore
46+ /.phpunit.cache / export-ignore
Original file line number Diff line number Diff line change 1+ name : Tests
2+
3+ on :
4+ push :
5+ branches : [ "2.x" ]
6+ pull_request :
7+ branches : [ "2.x" ]
8+
9+ permissions :
10+ contents : read
11+
12+ jobs :
13+ build :
14+
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - name : Validate composer.json and composer.lock
21+ run : composer validate --strict
22+
23+ - name : Cache Composer packages
24+ id : composer-cache
25+ uses : actions/cache@v3
26+ with :
27+ path : vendor
28+ key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29+ restore-keys : |
30+ ${{ runner.os }}-php-
31+
32+ - name : Install dependencies
33+ run : composer install --prefer-dist --no-progress
34+
35+ # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
36+ # Docs: https://getcomposer.org/doc/articles/scripts.md
37+
38+ - name : Run test suite
39+ run : composer run-script test
Original file line number Diff line number Diff line change 11.env
22/vendor /
33composer.lock
4-
4+ .phpunit.cache /
Original file line number Diff line number Diff line change 11![ Supabase] ( https://getlogo.net/wp-content/uploads/2020/11/supabase-logo-vector.png )
22
3-
3+ ![ Tests ] ( https://github.com/CodeWithSushil/supabase-client/actions/workflows/tests.yml/badge.svg )
44![ Packagist Downloads] ( https://img.shields.io/packagist/dt/supabase-php/supabase-client?style=for-the-badge&logo=composer )
55![ GitHub Release] ( https://img.shields.io/github/v/release/Ashishkumbhar01/supabase-php?style=for-the-badge )
66![ GitHub License] ( https://img.shields.io/github/license/Ashishkumbhar01/supabase-php?style=for-the-badge )
Original file line number Diff line number Diff line change 1515 "jerome/fetch-php" : " ^2.0"
1616 },
1717 "require-dev" : {
18- "pestphp/pest " : " ^3.8 " ,
19- "phpstan/phpstan " : " ^2 .1"
18+ "phpstan/phpstan " : " ^2.1 " ,
19+ "phpunit/phpunit " : " ^12 .1"
2020 },
2121 "license" : " MIT" ,
2222 "autoload" : {
5555 "post-root-package-install" : [
5656 " @php -r \" file_exists('.env') || copy('.env.example', '.env');\" "
5757 ],
58- "test: unit" : " pest --colors=always --parallel " ,
59- "test: types" : " phpstan analyse --ansi" ,
58+ "unit" : " phpunit " ,
59+ "types" : " phpstan analyse --ansi" ,
6060 "test" : [
61- " @test:unit" ,
62- " @test:types"
61+ " @unit"
6362 ]
6463 },
6564 "minimum-stability" : " dev" ,
Original file line number Diff line number Diff line change @@ -2,5 +2,6 @@ parameters:
22 level: max
33 paths:
44 - src
5+ - tests
56
67 reportUnmatchedIgnoredErrors: true
Original file line number Diff line number Diff line change 22<phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
33 xsi : noNamespaceSchemaLocation =" vendor/phpunit/phpunit/phpunit.xsd"
44 bootstrap =" vendor/autoload.php"
5- colors =" true"
6- >
5+ cacheDirectory =" .phpunit.cache"
6+ executionOrder =" depends,defects"
7+ requireCoverageMetadata =" true"
8+ beStrictAboutCoverageMetadata =" true"
9+ beStrictAboutOutputDuringTests =" true"
10+ displayDetailsOnPhpunitDeprecations =" true"
11+ failOnPhpunitDeprecation =" true"
12+ failOnRisky =" true"
13+ failOnWarning =" true" colors =" true" >
714 <testsuites >
8- <testsuite name =" Test Suite " >
9- <directory suffix = " Test.php " >./ tests</directory >
15+ <testsuite name =" default " >
16+ <directory > tests</directory >
1017 </testsuite >
1118 </testsuites >
12- <source >
19+
20+ <source ignoreIndirectDeprecations =" true" restrictNotices =" true" restrictWarnings =" true" >
1321 <include >
14- <directory >app</directory >
1522 <directory >src</directory >
1623 </include >
1724 </source >
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ <?php
2+ declare (strict_types=1 );
3+ namespace Tests ;
4+
5+ use PHPUnit \Framework \Attributes \CoversClass ;
6+ use PHPUnit \Framework \Attributes \Test ;
7+ use PHPUnit \Framework \TestCase ;
8+ use Supabase \Client \Functions as Supabase ;
9+ use Dotenv \Dotenv ;
10+
11+ #[CoversClass(Functions::class)]
12+ class SupabaseTest extends TestCase
13+ {
14+ #[Test]
15+ public function connected ()
16+ {
17+ $ dotenv = Dotenv::createImmutable (__DIR__ );
18+ $ dotenv ->safeLoad ();
19+
20+ $ config = [
21+ 'url ' => $ _ENV ['URL ' ],
22+ 'apikey ' => $ _ENV ['APIKEY ' ]
23+ ];
24+
25+ $ client = new Supabase ($ config ['url ' ], $ config ['apikey ' ]);
26+ $ this ->assertInstanceOf (Supabase::class, $ client );
27+ // $this->assertTrue($client->getAllData('Users'));
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments