- Issues should be filed at https://www.drupal.org/project/issues/commerce_google_tag_manager
- Pull requests can be made against https://github.com/gridonic/commerce_google_tag_manager/pulls
Github repo
git remote add github https://github.com/gridonic/commerce_google_tag_manager
Drupal repo
git remote add drupal [email protected]:project/commerce_google_tag_manager.git
First of all, you will need to have the following tools installed globally on your environment:
- drush
- Latest dev release of Drupal 8.x.
You must provide a SIMPLETEST_BASE_URL
, Eg. http://localhost
.
You must provide a SIMPLETEST_DB
, Eg. sqlite://localhost/build/commerce_google_tag_manager.sqlite
.
Run the functional tests:
# You must be on the drupal-root folder - usually /web.
$ cd web
$ SIMPLETEST_DB="sqlite://localhost//tmp/commerce_google_tag_manager.sqlite" \
SIMPLETEST_BASE_URL='http://sandbox.test' \
BROWSERTEST_OUTPUT_DIRECTORY="/path/to/webroot/browser_output" \
../vendor/bin/phpunit -c core \
--group commerce_google_tag_manager \
--printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --stop-on-error
You need to run composer before using PHPCS. Then register the Drupal and DrupalPractice Standard with PHPCS:
`./vendor/bin/phpcs --config-set installed_paths \
`pwd`/vendor/drupal/coder/coder_sniffer`
Check Drupal coding standards:
./vendor/bin/phpcs --standard=Drupal --colors \
--extensions=php,module,inc,install,test,profile,theme,info,md \
--ignore=*/vendor/*,*/node_modules/*,*/scripts/* --encoding=utf-8 ./
Check Drupal best practices:
./vendor/bin/phpcs --standard=DrupalPractice --colors \
--extensions=php,module,inc,install,test,profile,theme,info,md \
--ignore=*/vendor/*,*/node_modules/*,*/scripts/* --encoding=utf-8 ./
Automatically fix coding standards
./vendor/bin/phpcbf --standard=Drupal --colors \
--extensions=php,module,inc,install,test,profile,theme,info \
--ignore=*/vendor/*,*/node_modules/*,*/scripts/* ./
Add requirements if necessary using composer
:
composer install
Detect overcomplicated expressions & Unused parameters, methods, properties
./vendor/bin/phpmd ./ text ./phpmd.xml --suffixes \
php,module,inc,install,test,profile,theme,info,txt \
--exclude vendor,scripts
Copy/Paste Detector
./vendor/bin/phpcpd ./ \
--names=*.php,*.module,*.inc,*.install,*.test,*.profile,*.theme,*.info,*.txt \
--names-exclude=*.md,*.info.yml --progress --ansi \
--exclude=scripts --exclude=vendor
Checks compatibility with PHP interpreter versions
./vendor/bin/phpcf --target 7.2 \
--file-extensions php,module,inc,install,test,profile,theme,info \
./src
Maintaining code quality by adding the custom post-commit hook to yours.
cat ./scripts/hooks/post-commit >> ./.git/hooks/post-commit