Note: This factory class will look for MVC objects in BOTH component sections (front-end, back-end), not just the one you are currently running in. If no class is found a new object will be created magically. This is the same behaviour as FOF 2.x.
Наследование: extends SwitchFactory, implements FOF30\Factory\FactoryInterface
Пример #1
0
 /**
  * @group           MagicSwitchFactory
  * @covers          FOF30\Factory\MagicSwitchFactory::transparentAuthentication
  * @dataProvider    MagicSwitchFactoryDataprovider::getTestTransparentAuthentication
  */
 public function testTransparentAuthentication($test, $check)
 {
     $msg = 'MagicSwitchFactory::transparentAuthentication %s - Case: ' . $check['case'];
     $container = new TestContainer(array('componentName' => $test['component'], 'backEndPath' => $test['backend_path']));
     $platform = $container->platform;
     $platform::$isAdmin = $test['backend'];
     // Required so we force FOF to read the fof.xml file
     $dummy = $container->appConfig;
     $factory = new MagicSwitchFactory($container);
     $result = $factory->transparentAuthentication();
     $this->assertEquals($check['result'], get_class($result), sprintf($msg, 'Returned the wrong result'));
 }