Getting ready for development¶
Preparing the local environment¶
The following command will download Drupal 8 + Commerce 2.x with all
dependencies to the
composer create-project drupalcommerce/project-base mystore --prefer-source --stability dev
Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]?
This will keep the downloaded git repositories inside their parent folders (such
binfolder contains Drupal Console and PHPUnit.
webfolder represents the document root.
- Composer commands are always run from the site root (
mystorein this case).
- Downloading additional modules:
composer require "drupal/devel:1.x-dev"
- Updating an existing module:
composer update drupal/address –with-dependencies
See the project-base README for more details.
Preparing your fork¶
Note: You will need a GitHub account for contributing.
Visit the Commerce repository on GitHub and click the fork button. That will create a copy of the repository on your GitHub account.
Now go to the Commerce folder and add your fork:
cd web/modules/contrib/commerce git remote add fork email@example.com:YOUR_USER/commerce.git
Replace YOUR_USER with your username (the full url is shown on your fork’s GitHub page).
You will now be able to push new branches to your fork and create pull requests against the main repository.
All of the Drupal Commerce tests are based on the PHPUnit framework. In
order to run the tests you will need to copy the
from the core directory and modify it for your environment. An in depth
article on getting ready to run the tests can be found here:
1 2 3
cd mystore/web # Run PHPUnit tests ../bin/phpunit -c core/phpunit.xml modules/contrib/commerce