nystudio107 / generator-craftplugin

generator-craftplugin is a Yeoman generator for Craft CMS plugins
MIT License
74 stars 30 forks source link

Use of undefined constant CRAFT_TESTS_PATH - codecept #106

Open creode-dev opened 3 years ago

creode-dev commented 3 years ago

Describe the bug

Upon installation of the plugin with tests and installing the dependencies ready for plugin testing I encountered an error relating to an undefined constant.

To reproduce

Steps to reproduce the behaviour:

  1. Download the generated plugin in the attachments or use the online generator with the following settings: pluginfactory io_ magiclogin (1).zip
  2. Move into the directory on the Command line that the plugin is installed in
  3. Run php vendor/bin/codecept
  4. See the error attached: image

Expected behaviour

Codecept command should run with no errors in the output.

Screenshots

Attached as various steps above.

 To Fix

In order to fix this according to the craft documentation you can add the following into the _bootstrap.php file:

define('CRAFT_TESTS_PATH', __DIR__);

I'm happy to do this and submit a PR but wanted to log this issue to check it wasn't as designed.

Versions

khalwat commented 3 years ago

Submitting this via PR would be wonderful!