craftcms / docs

Documentation for Craft CMS, Craft Commerce, and other official products.
https://craftcms.com/docs
39 stars 150 forks source link

Improve “Setting Up Tests” #472

Open alexkuzmin opened 1 year ago

alexkuzmin commented 1 year ago

Maybe there is an error somewhere in https://craftcms.com/docs/4.x/testing/testing-craft/setup.html. I've made all the steps several times, and when I run codecept run unit, it thows an error: Fatal error: Uncaught Error: Class "Codeception\Module\Yii2" not found in /var/www/project/vendor/craftcms/cms/src/test/Craft.php:65.

Also, it seems that in codeception.yml under the paths block should be added the line: output: tests/_output.

Craft version: 4.3.8.2 PHP version: 8.1.14 Database driver & version: PostgreSQL 13.8 Codeception: 5.0.8

alexkuzmin commented 1 year ago

What helped me to make it work: composer require --dev codeception/module-yii2 then again vendor/bin/codecept build also, in .env-File in root: ALLOW_ADMIN_CHANGES=true

AugustMiller commented 1 year ago

As noted in #453:

We are pausing on testing docs while we evaluate Pest as an option, going forward.

Sorry for the lack of movement, here! I will make a note about this conversation on the relevant pages.