Move command over to new v2 structure
schlessera opened this issue · 0 comments
schlessera commented
The following changes need to be made to move the command over to the v2 structure:
- Make sure the correct framework is required:
composer require wp-cli/wp-cli:^2
- Require the testing framework as a dev dependency:
composer require --dev wp-cli/wp-cli-tests:^0
- Use the
.travis.yml
file fromwp-cli/wp-cli
:wget https://raw.githubusercontent.com/wp-cli/wp-cli/master/.travis.yml
- Add the default script configuration to Composer file:
"scripts": { "lint": "run-linter-tests", "phpcs": "run-phpcs-tests", "phpunit": "run-php-unit-tests", "behat": "run-behat-tests", "prepare-tests": "install-package-tests", "test": [ "@lint", "@phpcs", "@phpunit", "@behat" ] },
- Remove scaffolded binary files:
git rm bin/install-package-tests.sh git rm bin/test.sh
- Remove scaffolded Behat setup:
git rm features/bootstrap/* git rm features/extra/* git rm features/steps/*
- Remove scaffolded Behat tags util script:
git rm utils/behat-tags.php
- Add command packages that are needed for Behat tests as
--dev
dependencies.
The following commands are already available, anything else needs to be explicitly required:cli *
config *
core *
eval
eval-file
help
- Update all dependencies:
composer update
- Optional - Add PHPCS rule set to enable CS & compatibility sniffing:
wget https://raw.githubusercontent.com/wp-cli/wp-cli/master/phpcs.xml.dist
- Run and adapt tests to make sure they all pass:
composer test