Adldap\Laravel\Tests\TestCase::getMockConnection PHP Method

getMockConnection() protected method

protected getMockConnection ( $methods = [] )
    protected function getMockConnection($methods = [])
    {
        $defaults = ['isBound', 'search', 'getEntries', 'bind', 'close'];
        $connection = $this->getMockBuilder(Ldap::class)->setMethods(array_merge($defaults, $methods))->getMock();
        Adldap::getDefaultProvider()->setConnection($connection);
        return $connection;
    }