vortechron/nightwatch-testing
Composer 安装命令:
composer require vortechron/nightwatch-testing
包简介
Laravel package for testing Nightwatch monitoring events with comprehensive variations
README 文档
README
A Laravel package for testing Laravel Nightwatch monitoring events with comprehensive variations.
Installation
Local Development (Path Repository)
Add the package to your composer.json:
{
"repositories": [
{
"type": "path",
"url": "./packages/nightwatch-testing"
}
],
"require-dev": {
"vortechron/nightwatch-testing": "@dev"
}
}
Then run:
composer update vortechron/nightwatch-testing
Via Packagist (Coming Soon)
composer require --dev vortechron/nightwatch-testing
Configuration
Publish the configuration file:
php artisan vendor:publish --tag=nightwatch-testing-config
This will create a config/nightwatch-testing.php file with the following options:
return [ // User model for notification testing 'user_model' => 'App\\Models\\User', // Internal endpoints to test 'internal_endpoints' => [ 'success' => [ ['method' => 'GET', 'path' => '/health', 'description' => 'Health check'], ], 'redirect' => [ ['method' => 'GET', 'path' => '/settings', 'description' => 'Settings redirect'], ], 'client_error' => [ ['method' => 'GET', 'path' => '/api/user', 'expected_status' => [401, 403]], ], ], // Mail test recipients 'mail' => [ 'to' => 'nightwatch-test@example.com', 'cc' => 'nightwatch-cc@example.com', ], // Outgoing request test URL 'outgoing_request_url' => 'https://httpbin.org', ];
Usage
Run all Nightwatch test events:
php artisan nightwatch:test
Available Options
| Option | Description |
|---|---|
--skip-mail |
Skip sending test mail |
--skip-exception |
Skip triggering exception |
--skip-requests |
Skip outgoing HTTP request tests |
--skip-internal-requests |
Skip internal API request tests |
--skip-failing-job |
Skip failing job dispatch |
--skip-notifications |
Skip notification tests |
Examples
# Run all tests php artisan nightwatch:test # Skip mail and external requests php artisan nightwatch:test --skip-mail --skip-requests # Only test cache and queries php artisan nightwatch:test --skip-mail --skip-requests --skip-internal-requests --skip-exception --skip-failing-job --skip-notifications
Test Events Triggered
Commands
- Successful command execution
- Unsuccessful command (invalid arguments)
Database Queries
- Fast queries (count, indexed lookup, limited select)
- Slow queries (with sleep, complex aggregation)
Cache Operations
- WRITE:
put,forever,add - HIT: Multiple
getcalls on existing keys - MISS:
geton non-existent keys - DELETE:
forget, cleanup
Jobs
- PROCESSED: Successful job dispatch
- RELEASED: Job that releases back to queue
- FAILED: Job that throws exception
Notifications
- Database notification to first user
- SENT: Synchronous mail
- QUEUED: Async mail via queue
- SENT: Multiple recipients with CC
- QUEUED: Delayed mail
HTTP Requests (Internal)
- 2XX Success endpoints
- 3XX Redirect endpoints
- 4XX Client error endpoints
HTTP Requests (Outgoing)
- 2XX: 200, 201, 204
- 3XX: 301, 302
- 4XX: 400, 401, 403, 404, 422, 429
- 5XX: 500, 502, 503, 504
Exceptions
- Reported exception via
report()
Requirements
- PHP 8.2+
- Laravel 11.x or 12.x
License
MIT
vortechron/nightwatch-testing 适用场景与选型建议
vortechron/nightwatch-testing 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 vortechron/nightwatch-testing 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vortechron/nightwatch-testing 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-13