定制 jdgrimes/wpppb 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

jdgrimes/wpppb

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.

jdgrimes/wpppb 适用场景与选型建议

jdgrimes/wpppb 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.53k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2016 年 09 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 jdgrimes/wpppb 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 jdgrimes/wpppb 我们能提供哪些服务?
定制开发 / 二次开发

基于 jdgrimes/wpppb 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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