Open
Description
Description of the bug
While working on #111 , we learned that the default composer test
will fail after initial configure due to the current structure of navigating to cd plugins/[folder]
before running phpcs or phpunit and the resulting folder not having proper .phpcs.xml
(prefixes, names, etc) nor a proper phpunit.xml
.
Steps To Reproduce
- Clone this repo
- run
yes '' | php ./configure.php --project_name=cwp --author_name=cwp --author_email=cwp@alley.com
(accepting all defaults) - run
composer install
- run
composer test
- Observe failures
Additional Information
- Ensure plugin is cloned, scaffolded, search-replaced, config files generated so that when composer test is run it's working correctly.
- Ensure theme and plugin namespaces are just the name of the theme or plugin, without the
Alley\WP\
prefix, e.g.,Example_Plugin
notAlley\WP\Example_Plugin
. Ensure this is universally applied, including in template files for the scaffolder in the plugin. - Remove
./plugin-templates/
in.phpcs.xml
as part of scaffolding as it isn't necessary after the configure script has been run. - Add a new block to
.phpcs.xml
disabling the same check that was disabled in./plugin-templates/
but for the plugin's blocks folder instead. - Ensure phpunit configuration is present in the plugin folder after running the configure script.
- Ensure that the
xsi:noNamespaceSchemaLocation
property points to../../mu-plugins/vendor/phpunit/phpunit/phpunit.xsd
for both the plugin and the theme, and that this isclient-mu-plugins
instead ofmu-plugins
for a VIP install. - Ensure autoloader is properly being loaded in the plugin and theme so that tests pass.
- Ensure that Composer autoloader configuration is correct - for tests it should be PSR-4 format, not WordPress autoloader format.
- Ensure theme files and tests are added to the autoloader configuration now that create-wordpress-theme includes PHP components.