承接 wp-media/phpunit 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wp-media/phpunit

最新稳定版本:v3.0.4

Composer 安装命令:

composer require wp-media/phpunit

包简介

PHPUnit extender for bootstrapping unit and WordPress integration test suites.

README 文档

README

This reusable package bootstraps our PHPUnit unit and integration tests. It includes:

  • bootstrapping for both Unit and Integration tests
  • phpunit.xml.dist for each test suite
  • TestCase for each test suite
  • Common polyfill functions

This means your repo only needs its tests. w00t!

Configuring Composer in Your Repo

In your repo's composer.json file, add the following "require-dev" dependency:

"wp-media/phpunit": "^2.0"

Custom Bootstrapping Your Repo

Sometimes you need a custom bootstrapping solution in your repo, such as loading a factory, handling licensing, etc. Here are the steps to get you rolling:

  1. Add a bootstrap.php file in Unit or Integration directory.
  2. In your Tests/Integration/bootstrap.php file, add the following code to it:
tests_add_filter(
	'muplugins_loaded',
	function() {
		// Do your bootstrapping work here.
	}
);

Custom Test Case

When you need to customize the test case, extend off of the base test cases in this package:

  • For a custom integration, extend off of WPMedia\PHPUnit\Integration\TestCase.
  • For a custom unit, extend off of WPMedia\PHPUnit\Unit\TestCase.

统计信息

  • 总下载量: 153.72k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 65
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 14
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2020-02-05