承接 johnpbloch/wp-unit-test-project 相关项目开发

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

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

johnpbloch/wp-unit-test-project

Composer 安装命令:

composer create-project johnpbloch/wp-unit-test-project

包简介

A starter project for your WordPress plugin or theme unit tests

README 文档

README

I created this as an easy way to get a unit test suite started for testing WordPress plugins (and themes, I suppose).

Getting Started

To create a new project, you'll need Composer. You can use either a global installation or a local one. These instructions will work for global installations, but if you are using the PHAR in this project, just replace composer with php composer.phar in any commands that use composer.

To install, simply run the following command:

composer create-project johnpbloch/wp-unit-test-project my-project

my-project is the name of the directory in which it will install the package.

This installs a base package along with all the necessary dependencies. One of these dependencies is PHPUnit itself. You don't have to use the version installed by the package, but I thought it would be a good idea to include it too. This will work no matter where PHPUnit is installed as long as you are able to invoke it.

To run the tests, simply run PHPUnit:

vendor/bin/phpunit

I like to add ./vendor/bin to the front of my environment $PATH so that I can omit the path part of the command:

phpunit

If you're using Windows your command will be:

vendor\bin\phpunit

Next Steps

After you've installed the package, you'll want to edit composer.json to change the name from johnpbloch/wp-unit-test-project to something more appropriate to your project.

Now you need to import your project and write some tests for it!

Adding your project's code as a dependency in Composer is the recommended way to include it in this package, but using a git submodule or SVN external would also work.

Adding Tests to your Test Suite

By default, this package is configured to treat any PHP file in the tests directory as a unit test case. If you need to add other PHP files to the repo, either put them in a different directory or use a different file extension (such as .inc).

To create a new test, just create a new PHP file in the tests directory. This package comes with a custom TestCase class that extends PHPUnit's core TestCase. You should use the bundled test case when creating your test classes:

<?php

use JPB\TestTools\TestCase;

class MyNewTest extends TestCase {

}

Other Resources

统计信息

  • 总下载量: 91
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 21
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 21
  • Watchers: 4
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2013-11-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固