Skip to content

Cannot mock Latte template bridge since Nette v3 #235

@ciruvan

Description

@ciruvan

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions