Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

ViewHelperManager Service cannot be created outside Application context #176

Open
GeeH opened this issue Jun 28, 2016 · 1 comment
Open

Comments

@GeeH
Copy link
Contributor

GeeH commented Jun 28, 2016

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.


@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-mvc; a new issue has been opened at laminas/laminas-mvc#26.

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

No branches or pull requests

2 participants