public function reloadContainer() { $this->presenterFactory = NULL; $container = $this->getContainer(); $configurator = $this->getConfigurator(); $class = $container->parameters['container']['class'] . '_test_' . $this->containerCounter++; \Nette\Utils\LimitedScope::evaluate($configurator->buildContainer($dependencies, $class)); $this->container = new $class(); $this->container->initialize(); $this->container->addService('configurator', $configurator); }
public function testCreateViaForm() { $code = $this->fixCompile($this->compiler); eval($code); /** @var \Nette\DI\Container $container */ $container = new \Container(); $container->initialize(); $form = new \Nette\Forms\Container(); $this->assertInstanceOf('WebChemistry\\Forms\\Controls\\Multiplier', $form->addMultiplier('multiplier', function () { })); $form = new \Nette\Forms\Form(); $this->assertInstanceOf('WebChemistry\\Forms\\Controls\\Multiplier', $form->addMultiplier('multiplier', function () { })); }