WordPress Theme開発でもPHPUnitでのテストが行えないかなと思ってたので作ってみました。 wp-theme-phpunit function _manually_load_plugin() { register_theme_directory( dirname( __FILE__ ) . '/../../' ); switch_theme('your-theme'); } ↑ ポイントはここです。your-themeの部分を自身の開発中のTheme名に変更して、PHPUnitを実行させればOKです。 wp-plugin-unittest-dependency-patten ↑ こいつと組み合わせれば、自作のテーマに必要なプラグインもインストールした上でPHPUnitを実行できるようになります。 クライアントに納品用のサイトとかを作るときは、プラグインもそれぞれクライアント
昨日のVCCWを使ってWordPress環境をチームでまるごと共有するに引き続きぼっちアドベントカレンダー11日目の記事です。 今回の記事ではWordPressプラグインの開発に、Travis CIを使った継続的インテグレーション(Continuous Integration)を導入しようぜーという話です。 Travis CIを使うと何ができるようになるのか? WordPressのプラグイン開発にTravis CIを導入するとどんなメリットがあるんでしょう? まずはそこから紹介します。 GitHubにgit pushしたら自動的にphpunitが発火する。 プルリクが来た時も同じく自動的にphpunitが発火する。 複数のPHPバージョンを指定して、それぞれの環境でテストを行うことが可能。 複数のWordPressのバージョンを指定して、それぞれの環境でテストを行うことが可能。 マルチサイ
前の続き WordPress+PHPUnitで検索したところ、 WordPress › Support » Running WordPress tests with PHPUnit もあったのだけど、自分は http://stackoverflow.com/questions/9138215/unit-testing-wordpress-plugins からnb/wordpress-tests · GitHubを使用した。 wp-contents/plugins/pubman/tests/ に、ダウンロードしたwordpress-testsを一式置いて、 unittests-config.php を作成。この中身は、ほとんどwp-config.phpのDefineだけなんだけど、 $table_prefix = 'wp_'; と <?php // test settings テスト用にbo
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く