eZ\Publish\Core\Persistence\Legacy\Tests\TestCase::getDsn PHP Method

getDsn() protected method

The database connection string is read from an optional environment variable "DATABASE" and defaults to an in-memory SQLite database.
protected getDsn ( ) : string
return string
    protected function getDsn()
    {
        if (!$this->dsn) {
            $this->dsn = getenv('DATABASE');
            if (!$this->dsn) {
                $this->dsn = 'sqlite://:memory:';
            }
            $this->db = preg_replace('(^([a-z]+).*)', '\\1', $this->dsn);
        }
        return $this->dsn;
    }