Doctrine\ODM\MongoDB\Tests\BaseTest::skipTestIfNotSharded PHP Method

skipTestIfNotSharded() protected method

protected skipTestIfNotSharded ( $className )
    protected function skipTestIfNotSharded($className)
    {
        $result = $this->dm->getDocumentDatabase($className)->command(['listCommands' => true]);
        if (!$result['ok']) {
            $this->markTestSkipped('Could not check whether server supports sharding');
        }
        if (!array_key_exists('shardCollection', $result['commands'])) {
            $this->markTestSkipped('Test skipped because server does not support sharding');
        }
    }