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

Tests not running because of missing 'bootstrap' directive in 'phpunit.xml.dist' #145

Closed
MassiAtZend opened this issue Sep 19, 2016 · 5 comments
Assignees
Milestone

Comments

@MassiAtZend
Copy link

Running tests in a freshly cloned directory generates the following error:
Fatal error: Class 'Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase' not found in ../api-skel/module/Application/test/Controller/IndexControllerTest.php on line 13

The error is due to the fact the 'composer' autoloading logic is not included in the testing execution.

A simple fix is to add 'bootstrap="./vendor/autoload.php"' in 'phpunit.xml.dist' file.

@weierophinney weierophinney added this to the 1.4.1 milestone Oct 11, 2016
@weierophinney weierophinney self-assigned this Oct 11, 2016
weierophinney added a commit that referenced this issue Oct 11, 2016
weierophinney added a commit that referenced this issue Oct 11, 2016
@alextech
Copy link
Contributor

Bigger reason is lack of zend-test dependency in require-dev.

However, after installing, test still do not run complaining about some missing configuration cache. file_put_contents(data/cache/module-classmap-cache.application.module.cache.php): failed to open stream: No such file or directory

I am familiar with MVC skeleton, not fully understanding Apigility though to be able to fix both problems one time so, @weierophinney can you please give a hint, how/why configuration caching would interfere with unit test execution?

@alextech
Copy link
Contributor

Never mind, missing file_put_contents is a fault in my setup.

alextech added a commit to alextech/zf-apigility-skeleton that referenced this issue Aug 31, 2017
alextech added a commit to alextech/zf-apigility-skeleton that referenced this issue Aug 31, 2017
weierophinney added a commit that referenced this issue May 8, 2018
 #145 zend-test dependency to run unit test skeleton

Conflicts:
	composer.json
weierophinney added a commit that referenced this issue May 8, 2018
@weierophinney
Copy link
Member

Thanks, @alextech; will release with 1.5.0.

@weierophinney weierophinney changed the title Tests not running because of missing 'bootstrap' directive in 'phpunit.xml.dist' Tests not running because of missing 'bootstrap' directive in 'phpunit.xml.dist' May 8, 2018
@weierophinney weierophinney removed the bug label May 8, 2018
@worthwhileindustries
Copy link

@alextech can you elaborate on what the fix for this problem was?

"However, after installing, test still do not run complaining about some missing configuration cache. file_put_contents(data/cache/module-classmap-cache.application.module.cache.php): failed to open stream: No such file or directory"

"Never mind, missing file_put_contents is a fault in my setup."

@worthwhileindustries
Copy link

@alextech nevermind. added cache directory manually fixed it.

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

4 participants