@@ -17,20 +17,20 @@ public function getConfig(): array
1717 $ this ->markTestSkipped ();
1818 }
1919
20- $ host = getenv ('PG_HOST ' ) ?: 'localhost ' ;
21- $ user = getenv ('PG_USER ' ) ?: 'postgres ' ;
20+ $ host = getenv ('PG_HOST ' ) ?: 'localhost ' ;
21+ $ user = getenv ('PG_USER ' ) ?: 'postgres ' ;
2222 $ password = getenv ('PG_PASSWORD ' ) ?: null ;
2323 $ database = getenv ('PG_DB ' ) ?: 'codeception_test ' ;
24- $ dsn = getenv ('PG_DSN ' ) ?: 'pgsql:host= ' . $ host . ';dbname= ' . $ database ;
24+ $ dsn = getenv ('PG_DSN ' ) ?: 'pgsql:host= ' . $ host . ';dbname= ' . $ database ;
2525
2626 return [
27- 'dsn ' => $ dsn ,
28- 'user ' => $ user ,
29- 'password ' => $ password ,
30- 'dump ' => 'tests/data/dumps/postgres.sql ' ,
27+ 'dsn ' => $ dsn ,
28+ 'user ' => $ user ,
29+ 'password ' => $ password ,
30+ 'dump ' => 'tests/data/dumps/postgres.sql ' ,
3131 'reconnect ' => true ,
32- 'cleanup ' => true ,
33- 'populate ' => true
32+ 'cleanup ' => true ,
33+ 'populate ' => true ,
3434 ];
3535 }
3636
@@ -39,4 +39,12 @@ public function testHaveInDatabaseWithUppercaseTableName()
3939 $ testData = ['Status ' => 'test ' ];
4040 $ this ->module ->haveInDatabase ('NoPk ' , $ testData );
4141 }
42+
43+ public function testHaveInDatabaseWithAnotherSchema ()
44+ {
45+ $ userId =
$ this ->
module ->
haveInDatabase (
'anotherschema.users ' , [
'name ' =>
'anotherschema ' ,
'email ' =>
'[email protected] ' ]);
46+ $ this ->assertIsInt ($ userId );
47+
48+ $ this ->
module ->
seeInDatabase (
'anotherschema.users ' , [
'name ' =>
'anotherschema ' ,
'email ' =>
'[email protected] ' ]);
49+ }
4250}
0 commit comments