承接 jdgrimes/wpppb 相关项目开发

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

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

jdgrimes/wpppb

最新稳定版本:0.3.6

Composer 安装命令:

composer require jdgrimes/wpppb

包简介

Bootstrap for integration testing WordPress plugins with PHPUnit

README 文档

README

Bootstrap for integration testing WordPress plugins with PHPUnit.

Installation

composer require --dev jdgrimes/wpppb

Set Up

First, you will need a local checkout of the WordPress development repo, including the tests directory. The recommended way to get this, particularly if you intend to contribute to WordPress core, is with VVV. WPPPB builds on the testing tools already included with WordPress core, so it won't work without them.

Once you have a local copy of WordPress's tests directory, you can run the set-up script for WPPPB:

vendor/bin/wpppb-init

Answer the prompts, and you are ready to go!

Your tests will be placed in the tests directory that will be created in the root of your project (i.e., alongside the vendor directory added by Composer). Your plugin's source (the part that would be zipped up and installed on a WordPress site) is expected to be in a src directory alonside these two, and not in the root of your project itself. Example file structure would look like this:

- src/
  - my-plugin.php
  - includes/
  - etc.
- tests/
- vendor/

With a few modifications, you could probably use WPPPB with a different directory structure, but this is what it expects by default.

Usage

You can run your PHPUnit tests just as you normally would:

phpunit

You can also do other cool things like test your plugin's uninstall routine.

(Note that the default bootstrap utilizes Composer's PHP autoloader, which requires PHP 5.3. See here for instructions on usage with PHP 5.2.)

Purpose

The purpose of this project is to provide a bootstrap for plugin developers who want to perform integration tests for their plugin using WordPress core's testsuite. Its aim is not only to make this easier, but also better, by providing an implementation that makes the tests as realistic as possible.

To this end, the loader works by remotely activating the plugin(s), and letting WordPress load them just as it normally would. This provides more realistic testing than manually including and activating the plugins on the muplugins_loaded action, as is usually done.

License

This project's code is provided under the MIT license.

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固