Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot mock Latte template bridge since Nette v3 #235

Closed
ciruvan opened this issue Oct 4, 2019 · 0 comments
Closed

Cannot mock Latte template bridge since Nette v3 #235

ciruvan opened this issue Oct 4, 2019 · 0 comments

Comments

@ciruvan
Copy link

@ciruvan ciruvan commented Oct 4, 2019

We have tests in our project that test components which have dependencies on the Latte template engine class. In these tests, we mock that class like so:
$mockTemplateEngine = \Mockery::mock(Nette\Bridges\ApplicationLatte\Template::class);

This used to work flawlessly in v2, but not anymore, because since we switched to Nette v3 Template::__toString() has become final:

Fatal error: Cannot override final method Nette\Bridges\ApplicationLatte\Template::__toString() in [..]

I would love to see this method made non-final again - if that change wasn't unavoidable for some other reason - so we can mock Template::class again in our tests. Thank you!

@dg dg closed this in d6dd226 Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.