Permalink
Browse files

ApplicationExtension: presenters are not autowired

  • Loading branch information...
dg committed Feb 8, 2019
1 parent 42cb514 commit e0c3c0614d1592a95ac963d1db05fb42fe3c8f05
@@ -115,7 +115,8 @@ public function beforeCompile()
}
foreach ($all as $def) {
$def->addTag(Nette\DI\Extensions\InjectExtension::TAG_INJECT);
$def->addTag(Nette\DI\Extensions\InjectExtension::TAG_INJECT)
->setAutowired(false);
if (is_subclass_of($def->getType(), UI\Presenter::class)) {
$def->addSetup('$invalidLinkMode', [$this->invalidLinkMode]);
@@ -75,5 +75,6 @@ test(function () {
Assert::count(1, $container->findByType(Presenter1::class));
Assert::count(1, $container->findByType(Presenter2::class));
Assert::same('test', $container->getByType(Presenter1::class)->getView());
$name = $container->findByType(Presenter1::class)[0];
Assert::same('test', $container->createService($name)->getView());
});

0 comments on commit e0c3c06

Please sign in to comment.