Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
configs
languages
src
.gitattributes
.gitignore
.htaccess
LICENSE
README.md
composer.json
package_test.php

README.md

WP Content Framework (Test module)

License: GPL v2+ PHP: >=5.6 WordPress: >=3.9.3

WP Content Framework のモジュールです。

要件

  • PHP 5.6 以上
  • WordPress 3.9.3 以上

インストール

composer require wp-content-framework/test

依存モジュール

テストの追加

  • PHPUnitの追加
    composer require --dev phpunit/phpunit

  • src/classes/tests に PHP ファイル (例:sample.php) を追加

<?php

namespace Example_Plugin\Classes\Tests;

if ( ! defined( 'EXAMPLE_PLUGIN' ) ) {
	exit;
}

/**
 * Class Sample
 * @package Example_Plugin\Classes\Tests
 */
class Sample extends \WP_Framework\Classes\Tests\Base {

	public function test_sample1() {
		$this->assertEquals( 2, 1 + 1 );
	}

	public function test_sample2() {
		$this->assertEquals( 1, 1 + 1 );
	}

}
  • 管理画面から実行

test1

test2

Author

GitHub (Technote)
Blog

You can’t perform that action at this time.