PostgreSqlDbTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. require_once \Codeception\Configuration::testsDir().'unit/Codeception/Module/Db/TestsForDb.php';
  3. /**
  4. * @group appveyor
  5. * @group db
  6. */
  7. class PostgreSqlDbTest extends TestsForDb
  8. {
  9. public function getPopulator()
  10. {
  11. if (getenv('APPVEYOR')) {
  12. $this->markTestSkipped('Disabled on Appveyor');
  13. }
  14. if (getenv('WERCKER_ROOT')) {
  15. $this->markTestSkipped('Disabled on Wercker CI');
  16. }
  17. return "psql -d codeception_test -U postgres < tests/data/dumps/postgres.sql";
  18. }
  19. public function getConfig()
  20. {
  21. if (!function_exists('pg_connect')) {
  22. $this->markTestSkipped();
  23. }
  24. return [
  25. 'dsn' => 'pgsql:host=localhost;dbname=codeception_test',
  26. 'user' => 'postgres',
  27. 'password' => getenv('APPVEYOR') ? 'Password12!' : null,
  28. 'dump' => defined('HHVM_VERSION') ? 'tests/data/dumps/postgres-hhvm.sql' : 'tests/data/dumps/postgres.sql',
  29. 'reconnect' => true,
  30. 'cleanup' => true,
  31. 'populate' => true
  32. ];
  33. }
  34. }