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

ViewHelperManager Service cannot be created outside Application context #26

Closed
weierophinney opened this issue Dec 31, 2019 · 1 comment

Comments

@weierophinney
Copy link
Member

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7191
User: @boukeversteegh
Created On: 2015-02-06T13:54:40Z
Updated At: 2015-02-06T14:20:45Z
Body
To Bootstrap my unit tests, I had to use the ViewHelperManager to hydrate some entities (with zf-hal) and insert them in my ElasticSearch database, however since there is no Route and MvcEvent at this point, the following error occurred:

PHP Fatal error:  Call to a member function getRouteMatch() on null in
/var/www/app/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewHelperManagerFactory.php on line 70

Comment

User: @stefanotorresi
Created On: 2015-02-06T14:20:45Z
Updated At: 2015-02-06T14:20:45Z
Body
The factory is meant to be used within an initialized Zend\Mvc\Application. In your test, either set up a test application running init() explicitly with a mock config, or override the url plugin factory.



Originally posted by @GeeH at zendframework/zend-mvc#176

@samsonasik
Copy link
Member

closing due to invalid usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants