Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
本章では、これまでテスト駆動開発を行うための環境の構築方法について説明してきました。 ここからいよいよテスト駆動開発を用いてショートコードプラグインを作っていきます。 これから作るプラグインの機能について これから例として作るプラグインはショートコードプラグインです。 ショートコードとは、記事内に動的に変化するコンテンツを埋め込むための仕組みで、WordPressのデフォルトでは[gallery]というショートコードがあり、みなさんも使ったことがあると思います。 これを使用すると簡単なパラメータをPHPに渡して複雑な処理を行うことができ、私も以下のようなプラグインを公式ディレクトリに公開しています。 Simple Map – https://wordpress.org/plugins/simple-map/ Child Pages Shortcode – http://wordpress.
Unit tests are a tool that developers use to test that code is performing properly. The idea behind them is to create a set of tests to determine if your code, given a known data set, gives the expected response. A unit test should check that one piece of code, such as a function or method, runs properly and returns the expected results. Through this tutorial series, we will walk through how to se
When my WordPress plugin had only three users, it didn’t matter much if I broke it. By the time I reached 100,000 downloads, every new update made my palms sweat. My first goal for the WordPress Editorial Calendar was to make it do anything useful. I was new to JavaScript and PHP and didn’t really know what I could pull off. In a few days I had a proof of concept. In a few more I had a working ver
昨日、当ブログ管理画面でちょこちょこ遊んでいたら管理画面からユニットテストを実行できるプラグインを発見したので、紹介がてら簡単な使い方のご紹介。 wp-unit wp-unitはPHPUnitをベースとして作られたユニットテストプラグインです。 PHPUnitについての説明は割愛します。 PHPUnitをインストールする場合、現在利用しているPHPのバージョンに合わせてインストールして下さい。(4.3.0以上であればOKっぽいです) ※予めPHPUnitへパスを通しておく必要があります。 インストール 管理画面ログイン後、「プラグイン」メニューから新規追加を選択します。 検索ワードに「wp-unit」と入力し、検索します。 表示された画面から「wp-unit」を探します。 「インストール」をクリックし、インストールを終えます。 インストール完了後は以下のメニューが追加され、ユニットテストが
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く