File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 - " 18.1"
4545
4646 env :
47- DB_URL : ' pdo-pgsql://postgres:postgres@localhost:5432/eventstore?charset=utf8'
47+ POSTGRES_URI : ' pdo-pgsql://postgres:postgres@localhost:5432/eventstore?charset=utf8'
4848
4949 steps :
5050 - name : " Checkout"
9999 - " 12.1"
100100
101101 env :
102- DB_URL : ' mongodb://localhost:27017'
102+ MONGODB_URI : ' mongodb://localhost:27017'
103103
104104 steps :
105105 - name : " Checkout"
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ phpstan-baseline: vendor
2323
2424.PHONY : phpunit
2525phpunit : vendor # # run phpunit tests
26- XDEBUG_MODE=coverage vendor/bin/phpunit
26+ MONGODB_URI= " mongodb://localhost:27017 " POSTGRES_URI= " pgsql:host=localhost;port=5432;dbname=eventstore;user=postgres;password=postgres " XDEBUG_MODE=coverage vendor/bin/phpunit
2727
2828.PHONY : infection
2929infection : vendor # # run infection
Original file line number Diff line number Diff line change @@ -15,13 +15,18 @@ final class MongoIntegrationTest extends IntegrationTest
1515{
1616 protected function getClient (): Client
1717 {
18- $ uri = getenv ('MONGODB_URI ' ) ?: 'mongodb://localhost:27017 ' ;
18+ return new Client (getenv ('MONGODB_URI ' ));
19+ }
1920
21+ protected function setUp (): void
22+ {
2023 if (!class_exists (Client::class)) {
2124 $ this ->markTestSkipped ('mongodb/mongodb is not installed ' );
2225 }
2326
24- return new Client ($ uri );
27+ getenv ('MONGODB_URI ' ) ?: $ this ->markTestSkipped ('MONGODB_URI is not set ' );
28+
29+ parent ::setUp ();
2530 }
2631
2732 protected function getCollection (): Collection
Original file line number Diff line number Diff line change 1212
1313final class PostgresIntegrationTest extends IntegrationTest
1414{
15- protected function getClient (): Client
15+ protected function setUp (): void
1616 {
17- $ uri = getenv ('POSTGRES_URI ' ) ?: 'pgsql:host=localhost;port=5432;dbname=eventstore;user=postgres;password=postgres ' ;
17+ parent ::setUp ();
18+
19+ getenv ('POSTGRES_URI ' ) ?: $ this ->markTestSkipped ('POSTGRES_URI is not set ' );
20+ }
1821
19- return new Client ($ uri );
22+ protected function getClient (): Client
23+ {
24+ return new Client (getenv ('POSTGRES_URI ' ));
2025 }
2126
2227 protected function getCollection (): Collection
You can’t perform that action at this time.
0 commit comments