Open synatix opened 8 years ago
I appear to be getting the same problem
PHP Fatal error: Call to a member function getParam() on a non-object in /mnt/project/farmison/vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php on line 472
I'm able to pin it down to any route (and child routes) of any hostname
type route I have in my application - which is essentially most of the application.
'public' => [
'type' => 'hostname',
'options' => [
'route' => 'www.my-domain.com',
],
'child_routes' => [ ... etc
Update:
If I call $this->dispatch('http://www.my-domain.com/');
I appear to get a little bit further until I hit
1) FcoSiteTest\Controller\CheckoutControllerTest::testTheIndexActionCanBeAccessed
Undefined index: REQUEST_URI
/mnt/project/farmison/vendor/zendframework/zendframework/library/Zend/View/Helper/ServerUrl.php:59
/mnt/project/farmison/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php:393
This repository has been closed and moved to laminas/laminas-test; a new issue has been opened at https://github.com/laminas/laminas-test/issues/8.
We're using ZF2 for an web-application and want to test it with phpunit (v4.8.9). Within this application we've got a scheme-route, to be able to switch between http/https-context (Doesnt matter why...). The route looks like this:
The class of the test looks like this:
FYI: The "SynHttpControllerTestCase" is an extension from the original AbstractHttpControllerTestCase which comes with Zend-Test. It's modified to get the right bootstrap-file in our tests.
If we're running the tests, this error appears:
We looked into the AbstractControllerTestCase and this line is throwing the error:
$routeMatch = $this->getApplication()->getMvcEvent()->getRouteMatch();
Because the $routeMatch-Object is empty. We've some other controllers and tests within our application, they're all fine and not affected from this problem, cause the routes to these controllers arent scheme-routes.
Do you have any ideas how to solve this? In advance: we're not able to use static https-routes in this case.