lucatume/wp-browser
Composer 安装命令:
composer require lucatume/wp-browser
包简介
A set of Codeception modules to test WordPress projects.
关键字:
README 文档
README
You can use wp-browser to test WordPress sites, plugins and themes.
An easy and quick setup, with a default configuration that will work for most projects, run end-to-end tests, integration tests and unit tests all with the same tool.
This document refers to version
4of the project. If you're using version3or version3.5, and are looking for the migration and troubleshooting guide, you can find it here
Requirements
Depending on the nature of your project, there are different requirements it will need to satisfy before getting started.
Site
- Ensure you're running the
vendor/bin/codecept init wpbrowsercommand from the root directory of your WordPress site. - Ensure the directory contains the WordPress installation files. In a standard scenario you should have extracted WordPress files in this directory.
- Ensure your installation is configured: it should contain a
wp-config.phpfile.
Plugin
- Ensure you're running the
vendor/bin/codecept init wpbrowsercommand from the root directory of your plugin; this should be the directory that contains the PHP file defining the plugin header.
Theme
- Ensure you're running the
vendor/bin/codecept init wpbrowsercommand from the root directory of your theme; this should be the directory that contains thestyle.cssfile defining [the theme header][7].
If you decide to use the quick installation, then your PHP version should have the sqlite3 extensions installed and activated. You can check this using the php -m command and verifying the sqlite3 extension is among the active extensions.
Installation
Add wp-browser to your project as a development dependency using Composer
cd my-wordrpess-project
composer require --dev lucatume/wp-browser
Initialize wp-browser to quickly configured to suite your project and setup:
vendor/bin/codecept init wpbrowser
The command will set up your project to run integration and end-to-end tests using:
- SQLite as the database engine, leveraging the SQLite Database Integration plugin
- PHP built-in web server to serve the WordPress site on localhost (e.g.
http://localhost:8080) - Chromedriver to drive the local version of Chrome installed on your machine
If you're working on a plugin or theme project, the default configuration will add some extra steps:
- install the latest version of WordPress in the
tests/_wordpressdirectory - create a
tests/_pluginsdirectory: any file or directory in this directory will be symlinked into the WordPress installation intests/_wordpress/wp-content/plugins - create a
tests/_themesdirectory: any file or directory in this directory will be symlinked into the WordPress installation intests/_wordpress/wp-content/themes
For most projects this configuration will be enough to get started with testing.
You can run your tests immediately using the vendor/bin/codecept run command.
Read more about the commands provided by the library here.
Using a custom configuration
If you decide to skip the default configuration, you will be able to set up wp-browser to suit your needs and local
setup by editing the tests/.env file.
The inline documentation in the file will guide you through the configuration process.
Read more about using a custom configuration here.
Getting support for wp-browser configuration and usage
The best place to get support for wp-browser is the project documentation.
Since this project builds on top of PHPUnit and Codeception, you can also refer to their documentation.
If you can't find the answer to your question here you can ask on the "Issues" section of the wp-browser repository taking care to provide as much information as possible.
Finally, you can contact me directly to set up a call to discuss your project needs and how wp-browser can help you.
Sponsors
A thanks to my sponsors: you make maintaining this project easier.
lucatume/wp-browser 适用场景与选型建议
lucatume/wp-browser 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.08M 次下载、GitHub Stars 达 638, 最近一次更新时间为 2014 年 06 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 「codeception」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lucatume/wp-browser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lucatume/wp-browser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lucatume/wp-browser 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Connection 'Db' codeception module to 'Yii2' module database settings
Mailtrap module for Codeception
Qase TMS Codeception reporter.
Run codeception in multiple modes in mvc structure
Codeception module for Yii2 framework
Must-use plugin integrating WordPress with the Upsun platform: environment awareness, router-cache friendliness, safe preview clones, deploy migrations, Site Health checks, and a wp upsun CLI command.
统计信息
- 总下载量: 4.08M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 643
- 点击次数: 21
- 依赖项目数: 156
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2014-06-16