Skip to content

Instantly share code, notes, and snippets.

@mignonstyle
Last active June 30, 2017 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mignonstyle/37a9ea9ddc088a33ffde56c4e991d2ac to your computer and use it in GitHub Desktop.
Save mignonstyle/37a9ea9ddc088a33ffde56c4e991d2ac to your computer and use it in GitHub Desktop.
Method of Travis CI and Unit Test

Method of Travis CI and Unit Test

WP-CLI+PHPUnitを使ったWordPressプラグインのユニットテスト(1)
WP-CLI+PHPUnitを使ったWordPressプラグインのユニットテスト(2)

1. Installing PHPUnit

https://phpunit.de/manual/current/ja/installation.html

1-1. wgetコマンドをインストール(PHPUnitのインストールで使用するため)

1-2. PHP5.6をインストール

2. Writing Tests for PHPUnit

https://phpunit.de/manual/current/ja/writing-tests-for-phpunit.html

2-1. PHPUnitのテストコードを試してみる

3. WordPressのテーマやプラグインにTravis CIを導入する

4.テストツール

PHP_CodeSniffer

https://github.com/squizlabs/PHP_CodeSniffer

4-1. WordPress-Coding-Standards

https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards

4-2. PHPMD

https://phpmd.org/

4-3. sass-lint (gulp-sass-lint)

https://www.npmjs.com/package/gulp-sass-lint

gulpのプラグインでtravisのエラーが出るときの対処法

4-4. gulp-jshint

https://www.npmjs.com/package/gulp-jshint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment