You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
In testing a controller I get this error.
PHPUnit 3.7.15 by Sebastian Bergmann.
Configuration read from
/home/egidio/NetBeansProjects/school_gear/module/Guest/test/phpunit.xml
E
Time: 0 seconds, Memory: 4.75Mb
There was 1 error:
Invalid argument supplied for foreach()
/home/egidio/NetBeansProjects/school_gear/vendor/ZF2/Zend/ModuleManager/Listener/ConfigListener.php:354
/home/egidio/NetBeansProjects/school_gear/vendor/ZF2/Zend/ModuleManager/Listener/ConfigListener.php:147
/home/egidio/NetBeansProjects/school_gear/vendor/ZF2/Zend/EventManager/EventManager.php:460
/home/egidio/NetBeansProjects/school_gear/vendor/ZF2/Zend/EventManager/EventManager.php:204
/home/egidio/NetBeansProjects/school_gear/vendor/ZF2/Zend/ModuleManager/ModuleManager.php:100
/home/egidio/NetBeansProjects/school_gear/vendor/ZF2/Zend/Mvc/Application.php:239
/home/egidio/NetBeansProjects/school_gear/vendor/ZF2/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php:146
/home/egidio/NetBeansProjects/school_gear/vendor/ZF2/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php:173
/home/egidio/NetBeansProjects/school_gear/vendor/ZF2/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php:193
/home/egidio/NetBeansProjects/school_gear/vendor/ZF2/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php:236
/home/egidio/NetBeansProjects/school_gear/module/Guest/test/GuestTest/Controller/LoginControllerTest.php:15
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
These are involved files.
phpunit.xml
./GuestTest ##Bootstrap.php
array( 'module_paths' => $zf2ModulePaths, ), 'modules' => array('Application','Guest') ); $serviceManager = new \Zend\ServiceManager\ServiceManager( new \Zend\Mvc\Service\ServiceManagerConfig()); $serviceManager->setService('ApplicationConfig', $config); $serviceManager->get('ModuleManager')->loadModules(); static::$serviceManager = $serviceManager; } public static function getServiceManager() { return static::$serviceManager; } protected static function initAutoloader() { $vendorPath = static::findParentPath('vendor'); $zf2Path = getenv('ZF2_PATH'); if (!$zf2Path) { if (defined('ZF2_PATH')) { $zf2Path = ZF2_PATH; } else { if (is_dir($vendorPath . '/ZF2/library')) { $zf2Path = $vendorPath . '/ZF2/library'; } } } if (!$zf2Path) { throw new \RuntimeException('Unable to load ZF2.'); } include $zf2Path . '/Zend/Loader/AutoloaderFactory.php'; \Zend\Loader\AutoloaderFactory::factory(array( 'Zend\Loader\StandardAutoloader' => array( 'autoregister_zf' => true, 'namespaces' => array( _NAMESPACE_ => _DIR_ . '/' . _NAMESPACE_, ), ), )); } protected static function findParentPath($path) { $dir = _DIR_; $previousDir = '.'; while (!is_dir($dir . '/' . $path)) { $dir = dirname($dir); if ($previousDir === $dir) return false; $previousDir = $dir; } return $dir . '/' . $path; } } ## Bootstrap::init(); LoginControllerTest.php setApplicationConfig($config); parent::setUp(); } public function testGuestCanAccessLoginPage() { $this->dispatch('/login'); $this->assertResponseStatusCode(200); } ## }The text was updated successfully, but these errors were encountered: