bedezign / yii2-audit

Yii2 Audit records and displays web/cli requests, database changes, php/js errors and associated data.
https://bedezign.github.io/yii2-audit/
Other
193 stars 112 forks source link

Class 'yii\codeception\TestCase' not found when running functional tests #203

Closed thyseus closed 6 years ago

thyseus commented 7 years ago

Hey !!

i want to contribute some unit tests for some of my PRs.

Unfortunately i struggle getting the test suite to run:

$ codecept run
Codeception PHP Testing Framework v2.2.1
Powered by PHPUnit 5.4.8 by Sebastian Bergmann and contributors.

Bedezign\yii2\audit\tests.functional Tests (14) ------------
+ EntryGridCept: Ensure that entry grid works (0.41s)
+ EntryViewCept: Ensure that entry view and panels works (0.62s)
+ EntryViewInvalidIdCept: Ensure that entry view gives error with bad id (0.5s)
+ ErrorGridCept: Ensure that error grid works (0.3s)
+ ErrorViewCept: Ensure that error view works (0.3s)
+ ErrorViewInvalidIdCept: Ensure that error view gives error with bad id (0.3s)
+ HomeCept: Ensure that home page works (0.51s)
+ JavascriptGridCept: Ensure that javascript grid works (0.2s)
+ JavascriptViewCept: Ensure that javascript view gives error with bad id (0.6s)
+ MailDownloadCept: Ensure that mail download gives error with bad id (0.7s)
+ MailGridCept: Ensure that mail grid works (0.2s)
+ MailViewCept: Ensure that mail view gives error with bad id (0.6s)
+ TrailGridCept: Ensure that trail grid works (0.3s)
+ TrailViewCept: Ensure that trail view gives error with bad id (0.7s)
------------------------------------------------------------
PHP Fatal error:  Class 'yii\codeception\TestCase' not found in C:\xampp\htdocs\hydra\vendor\thyseus\yii2-audit\tests\codeception\unit\AuditTestCase.php on line 7

FATAL ERROR. TESTS NOT FINISHED.
Class 'yii\codeception\TestCase' not found
in C:\xampp\htdocs\hydra\vendor\thyseus\yii2-audit\tests\codeception\unit\AuditTestCase.php:7
<pre>PHP Fatal Error &#039;yii\base\ErrorException&#039; with message &#039;Class &#039;yii\codeception\TestCase&#039; not found&#039;

in C:\xampp\htdocs\hydra\vendor\thyseus\yii2-audit\tests\codeception\unit\AuditTestCase.php:7

Stack trace:
#0 [internal function]: yii\base\ErrorHandler-&gt;handleFatalError()
#1 {main}</pre>

Any ideas on what i am doing wrong?

Thanks a lot !

cornernote commented 7 years ago

It looks like you're not using composer-ci.json.

Try this:

export COMPOSER=composer-ci.json
composer -v install

Please follow all the instructions here: https://github.com/bedezign/yii2-audit/blob/master/tests/README.md