/** * @covers \ZfcUser\Authentication\Adapter\AdapterChainServiceFactory::createService */ public function testCreateService() { $this->options->expects($this->once())->method('getAuthAdapters')->will($this->returnValue(array())); $this->markTestIncomplete('Test needs to check inside attach adapter loop'); $adapterChain = $this->factory->createService($this->serviceLocator); $this->assertInstanceOf('ZfcUser\\Authentication\\Adapter\\AdapterChain', $adapterChain); }
public function createService(ServiceLocatorInterface $services) { $factory = new AdapterChainServiceFactory(); $chain = $factory->createService($services); $adapter = $services->get('ScnSocialAuth\\Authentication\\Adapter\\HybridAuth'); $chain->getEventManager()->attach('authenticate', array($adapter, 'authenticate'), 1000); return $chain; }
public function createService(ServiceLocatorInterface $services) { // Temporarily replace the adapters in the module options with the HybridAuth adapter $zfcUserModuleOptions = $services->get('zfcuser_module_options'); $currentAuthAdapters = $zfcUserModuleOptions->getAuthAdapters(); $zfcUserModuleOptions->setAuthAdapters(array(100 => 'ScnSocialAuth\\Authentication\\Adapter\\HybridAuth')); // Create a new adapter chain with HybridAuth adapter $factory = new AdapterChainServiceFactory(); $chain = $factory->createService($services); // Reset the adapters in the module options $zfcUserModuleOptions->setAuthAdapters($currentAuthAdapters); return $chain; }
/** * @covers \ZfcUser\Authentication\Adapter\AdapterChainServiceFactory::getOptions * @expectedException \ZfcUser\Authentication\Adapter\Exception\OptionsNotFoundException */ public function testGetOptionFailing() { $options = $this->factory->getOptions(); }