/** * @covers FOF30\Factory\Magic\TransparentAuthenticationFactory::make * @dataProvider getTestMake */ public function testMake($test, $check) { $msg = 'TransparentAuthenticationFactory::make %s - Case: ' . $check['case']; $config['componentName'] = $test['component']; if ($test['backend_path']) { $config['backEndPath'] = $test['backend_path']; } $container = new TestContainer($config); // Required so we force FOF to read the fof.xml file $dummy = $container->appConfig; $factory = new TransparentAuthenticationFactory($container); $result = $factory->make(array()); $this->assertEquals($check['result'], get_class($result), sprintf($msg, 'Returned the wrong result')); }
/** * Creates a new TransparentAuthentication * * @param array $config The configuration values for the TransparentAuthentication object * * @return TransparentAuthentication */ public function transparentAuthentication(array $config = array()) { $toolbarClass = $this->container->getNamespacePrefix($this->getSection()) . 'TransparentAuthentication\\TransparentAuthentication'; try { return $this->createTransparentAuthentication($toolbarClass, $config); } catch (TransparentAuthenticationNotFound $e) { // Not found. Let's go on. } $toolbarClass = $this->container->getNamespacePrefix('inverse') . 'TransparentAuthentication\\TransparentAuthentication'; try { return $this->createTransparentAuthentication($toolbarClass, $config); } catch (TransparentAuthenticationNotFound $e) { // Not found. Return the magically created TransparentAuthentication $magic = new TransparentAuthenticationFactory($this->container); // Let's pass the section override (if any) $magic->setSection($this->getSection()); return $magic->make($config); } }
/** * Creates a new TransparentAuthentication handler * * @param array $config The configuration values for the TransparentAuthentication object * * @return TransparentAuthentication */ public function transparentAuthentication(array $config = array()) { $authClass = $this->container->getNamespacePrefix() . 'TransparentAuthentication\\TransparentAuthentication'; try { return $this->createTransparentAuthentication($authClass, $config); } catch (TransparentAuthenticationNotFound $e) { // Not found. Return the magically created TA $magic = new TransparentAuthenticationFactory($this->container); return $magic->make($config); } }