/** * This test demonstrates that all attributes are set * properly on construct. */ public function testAdldapConstructConfig() { $connection = $this->newConnectionMock(); $connection->shouldReceive('isSupported')->andReturn(true); $connection->shouldReceive('isSaslSupported')->andReturn(true); $connection->shouldReceive('useSSO')->andReturn(true); $connection->shouldReceive('useSSL')->andReturn(true); $connection->shouldReceive('useTLS')->andReturn(true); $connection->shouldReceive('startTLS')->andReturn(true); $connection->shouldReceive('isUsingSSL')->andReturn(true); $connection->shouldReceive('isUsingTLS')->andReturn(true); $connection->shouldReceive('isUsingSSO')->andReturn(true); $connection->shouldReceive('connect')->once()->andReturn(true); $connection->shouldReceive('setOption')->twice()->andReturn(true); $connection->shouldReceive('bind')->andReturn('resource'); $connection->shouldReceive('isBound')->andReturn(true); $connection->shouldReceive('close')->andReturn(true); $ad = new Adldap($this->configStub, $connection); $this->assertInstanceOf('Adldap\\Interfaces\\ConnectionInterface', $ad->getLdapConnection()); $this->assertEquals(500, $ad->getPort()); $this->assertEquals(['dc1', 'dc2'], $ad->getDomainControllers()); $this->assertEquals('Base DN', $ad->getBaseDn()); $this->assertEquals('Account Suffix', $ad->getAccountSuffix()); $this->assertTrue($ad->getRecursiveGroups()); $this->assertTrue($ad->getUseSSL()); $this->assertTrue($ad->getUseTLS()); $this->assertTrue($ad->getUseSSO()); }