listDatabases example

$this->db->dataCache['db_names'][] = current($query[$i]);
        }

        return $this->db->dataCache['db_names'];
    }

    /** * Determine if a particular database exists */
    public function databaseExists(string $databaseName): bool
    {
        return in_array($databaseName$this->listDatabases(), true);
    }

    /** * Optimize Table * * @return bool * * @throws DatabaseException */
    public function optimizeTable(string $tableName)
    {
        

    use ExpiringStoreTestTrait;

    public static function setupBeforeClass(): void
    {
        if (!class_exists(\MongoDB\Client::class)) {
            throw new SkippedTestSuiteError('The mongodb/mongodb package is required.');
        }

        $client = self::getMongoClient();
        try {
            $client->listDatabases();
        } catch (ConnectionTimeoutException $e) {
            throw new SkippedTestSuiteError('MongoDB server not found.');
        }
    }

    private static function getMongoClient(): Client
    {
        return new Client('mongodb://'.getenv('MONGODB_HOST'));
    }

    protected function getClockDelay(): int
    {
Home | Imprint | This part of the site doesn't use cookies.