Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
TPresenter: use IPresenterFactory::createPresenter to create a presen…
Browse files Browse the repository at this point in the history
…ter instance
  • Loading branch information
matej21 committed Aug 10, 2016
1 parent 414e09d commit a38c52d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Traits/TPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ protected function check($destination, $params = [], $post = [])
$url = new \Nette\Http\UrlScript($container->parameters['testbench']['url']);
$container->addService('httpRequest', new Mocks\HttpRequestMock($url, $params, $post, [], [], $headers));
$presenterFactory = $container->getByType('Nette\Application\IPresenterFactory');
$class = $presenterFactory->getPresenterClass($presenter);
$this->__testbench_presenter = $container->createInstance($class);
$this->__testbench_presenter = $presenterFactory->createPresenter($presenter);
$this->__testbench_presenter->autoCanonicalize = FALSE;
$this->__testbench_presenter->invalidLinkMode = \Nette\Application\UI\Presenter::INVALID_LINK_EXCEPTION;
$container->callInjects($this->__testbench_presenter);

$postCopy = $post;
if (isset($params['do'])) {
Expand Down

0 comments on commit a38c52d

Please sign in to comment.