/** * Create Object Manager. * * @param array $sharedInstances * @return ObjectManager */ public function create(array $sharedInstances = []) { if (!defined('MTF_TESTS_PATH')) { define('MTF_TESTS_PATH', MTF_BP . '/tests/app/'); } if (!defined('MTF_STATES_PATH')) { define('MTF_STATES_PATH', MTF_BP . '/lib/Magento/Mtf/App/State/'); } $diConfig = new $this->configClassName(); $factory = new Factory($diConfig); $argInterpreter = $this->createArgumentInterpreter(new BooleanUtils()); $argumentMapper = new \Magento\Mtf\ObjectManager\Config\Mapper\Dom($argInterpreter); $sharedInstances['Magento\\Mtf\\Data\\Argument\\InterpreterInterface'] = $argInterpreter; $sharedInstances['Magento\\Mtf\\ObjectManager\\Config\\Mapper\\Dom'] = $argumentMapper; $objectManager = new $this->locatorClassName($factory, $diConfig, $sharedInstances); $factory->setObjectManager($objectManager); ObjectManager::setInstance($objectManager); self::configure($objectManager); return $objectManager; }
/** * Create Object Manager * * @param array $sharedInstances * @return ObjectManager */ public function create(array $sharedInstances = []) { if (!defined('MTF_TESTS_PATH')) { define('MTF_TESTS_PATH', MTF_BP . '/tests/app/'); } if (!defined('MTF_STATES_PATH')) { define('MTF_STATES_PATH', MTF_BP . '/lib/Magento/Mtf/App/State/'); } $diConfig = new $this->configClassName(); $factory = new Factory($diConfig); $argInterpreter = $this->createArgumentInterpreter(new BooleanUtils()); $argumentMapper = new \Magento\Mtf\ObjectManager\Config\Mapper\Dom($argInterpreter); $autoloader = new \Magento\Mtf\Code\Generator\Autoloader(new \Magento\Mtf\Code\Generator(['page' => 'Magento\\Mtf\\Util\\Generate\\Page', 'repository' => 'Magento\\Mtf\\Util\\Generate\\Repository', 'fixture' => 'Magento\\Mtf\\Util\\Generate\\Fixture'])); spl_autoload_register([$autoloader, 'load']); $sharedInstances['Magento\\Mtf\\Data\\Argument\\InterpreterInterface'] = $argInterpreter; $sharedInstances['Magento\\Mtf\\ObjectManager\\Config\\Mapper\\Dom'] = $argumentMapper; $objectManager = new $this->locatorClassName($factory, $diConfig, $sharedInstances); $factory->setObjectManager($objectManager); ObjectManager::setInstance($objectManager); self::configure($objectManager); return $objectManager; }