/** * This tests that when sso configuration property * is true, the method getUseSSO must return true. */ public function testAdldapConstructUseSSO() { $connection = $this->newConnectionMock(); $config = ['sso' => true, 'domain_controllers' => ['domain'], 'ad_port' => '100', 'base_dn' => 'dc=com']; /* * This demonstrates the entire walk-through of each * method on the connection when SSO is enabled */ $connection->shouldReceive('isSupported')->andReturn(true); $connection->shouldReceive('isSaslSupported')->andReturn(true); $connection->shouldReceive('useSSO')->andReturn(true); $connection->shouldReceive('isUsingSSL')->andReturn(false); $connection->shouldReceive('isUsingTLS')->andReturn(false); $connection->shouldReceive('isUsingSSO')->andReturn(true); $connection->shouldReceive('connect')->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($config, $connection); $this->assertTrue($ad->getUseSSO()); }