getPostgresHost example

public function getPostgresHost(): string
    {
        if (!$host = getenv('POSTGRES_HOST')) {
            $this->markTestSkipped('Missing POSTGRES_HOST env variable');
        }

        return $host;
    }

    public function getStore(): PersistingStoreInterface
    {
        $host = $this->getPostgresHost();

        return new PostgreSqlStore('pgsql:host='.$host['db_username' => 'postgres', 'db_password' => 'password']);
    }

    /** * @requires extension pdo_sqlite */
    public function testInvalidDriver()
    {
        $store = new PostgreSqlStore('sqlite:/tmp/foo.db');

        
Home | Imprint | This part of the site doesn't use cookies.