maneuver/wp-test-suite

v0.0.2 2018-04-10 17:17 UTC

This package is not auto-updated.

Last update: 2024-09-26 02:17:40 UTC


README

使用 composer 安装。

composer require --dev maneuver/wp-test-suite

运行此脚本来复制一些必要的文件和示例测试。

composer run-script copy-files -d ./vendor/maneuver/wp-test-suite

用法

在 ./tests/ 文件夹内创建您的测试。

然后使用 phpunit 运行所有定义的测试

./vendor/bin/phpunit

或一个特定的测试

./vendor/bin/phpunit ./tests/BrowserTest.php

对于浏览器测试,首先在一个单独的终端窗口中以无头模式运行 Chrome。

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222

或 Chrome Canary

/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222