Community编程与开发github.com

Taldres/laravel-waitlist

在编写、编辑、修复或审查使用 Pest 4/5 和 Orchestra Testbench 的包测试时使用此技能,包括 TDD、功能测试、单元测试、类型覆盖率、架构测试、工作台行为、命令、路由、配置、迁移和可发布资源。

laravel-waitlist 是什么?

该技能旨在指导开发者高效地为 Laravel 包编写和测试代码,特别专注于使用 Pest 4/5 和 Orchestra Testbench 进行测试。它遵循 TDD(测试驱动开发)原则,鼓励先编写最小的失败测试,然后实现通过测试的代码。技能涵盖了功能测试、单元测试、架构测试、类型覆盖率测试,以及测试工作台行为、命令、路由、配置和迁移等场景。它提供了清晰的工作流程,包括使用特定的 Composer 命令进行迭代和最终验证,并强调了在测试套件中保留真实包测试、删除临时脚手架测试的最佳实践。通过引用本地的 `tests/TestCase.php` 和 `Pest.php` 文件,该技能帮助开发者确保包的行为正确,避免常见的反模式,如依赖冒烟测试或测试实现细节。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Taldres/laravel-waitlist/tree/HEAD/.agents/skills/package-testing

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

包测试

主要目标

在使用 Pest 4/5、Orchestra Testbench 以及本地的 tests/TestCase.php 设置之前或实现代码的同时,证明包的行为。

工作流程

  1. 从 TDD 开始:针对所需行为编写最小的失败包测试,然后实现使测试通过的最小更改。
  2. 当功能具有有意义的失败模式时,覆盖快乐路径、不快乐路径和边缘情况行为。
  3. 优先使用聚焦的功能测试来验证包的集成行为,使用架构测试来验证广泛的约束。
  4. 迭代时使用 composer test:unit -- --filter ...,当类型敏感的测试或代码发生更改时使用 composer test:types,在完成前使用 composer test。
  5. 在测试套件中保留真实的包测试,仅移除那些为本地脚手架实验明确创建的临时测试。

参考资料

  • tests/TestCase.php
  • tests/Pest.php
  • tests/Feature/
  • tests/Unit/
  • tests/ArchTest.php
  • composer.json 脚本

示例

  • 通过断言默认包配置,然后在 Testbench 应用程序中覆盖主机配置值,来测试配置合并和配置覆盖。
  • 通过调用供应商发布行为并断言目标路径存在,来测试可发布的资源、迁移、视图、语言文件或配置。
  • 使用 Testbench HTTP 请求测试路由,使用 Artisan 断言测试命令,使用 SQLite 测试数据库测试迁移,以及在需要时在 composer build 后测试工作台行为。

反模式

  • 因为真实包测试不便而删除它们。
  • 当行为需要断言时,仅依赖冒烟测试。
  • 在可以观察包行为时,测试实现细节。
  • 在包测试套件中保留临时的脚手架实验测试。

Individual skills in this repo

This repo contains 13 individual skills — each has its own dedicated page.

Taldres/laravel-waitlist

Use this skill when reviewing Laravel package compatibility across composer constraints, PHP versions, Laravel versions, Testbench versions, dependency stability lanes, Windows CI, or matrix-sensitive code and workflow changes.

Taldres/laravel-waitlist

Use this skill when creating or updating the bundled Laravel Boost skill under resources/boost/skills from the package implementation and package documentation. Trigger after public APIs, commands, config, routes, views, publish tags, README content, or examples change.

Taldres/laravel-waitlist

Use this skill when preparing Laravel package releases: CHANGELOG.md updates, generated release notes, GitHub release workflows, version checks, tags, release validation, or release automation changes. Never publish autonomously.

Taldres/laravel-waitlist

Use this skill when adding Laravel package capabilities or wiring them through the service provider: commands, migrations, routes, config merges, views, translations, assets, middleware, publish tags, workbench files, or console-only behavior.

Taldres/laravel-waitlist

Integrate taldres/laravel-waitlist in a Laravel application: define purposes, lists and fields, build the signup form, send the confirmation mail from events, add a preference page, and keep consent, retention and encryption intact.

Taldres/laravel-waitlist

Build the pages of a taldres/laravel-waitlist integration: the signup form with the registered wording, and the confirm, unsubscribe and preference pages, either in Laravel controllers (Blade, Livewire, Inertia) or in an SPA or static site over the package's JSON API, including CORS and bot protection.

Taldres/laravel-waitlist

Turn a taldres/laravel-waitlist waitlist into a launch: invite people in batches in signup order, let invited addresses register, announce the launch to everyone who agreed, and erase the list once its purpose is fulfilled.

Taldres/laravel-waitlist

Send the mails of a taldres/laravel-waitlist integration: the double opt-in confirmation, the preference page link, a welcome mail, launch mails and newsletters to the people who agreed, with the right unsubscribe links, one-click headers and a sender per project.

Taldres/laravel-waitlist

Operate a taldres/laravel-waitlist installation: answer access and erasure requests, withdraw a purpose on request, apply retention, erase a list once its purpose is fulfilled, rotate APP_KEY with waitlist:rekey, export a list, and check the setup before going live.

Taldres/laravel-waitlist

Run the waitlists of several products in one Laravel app with taldres/laravel-waitlist projects: define projects, scope facade calls with project(), resolve the project of HTTP signups, send mail per project, handle requests across all projects, or keep projects in a database for a central waitlist API.

Taldres/laravel-waitlist

Keep a newsletter tool such as Brevo, Mailchimp or Mailcoach in step with a taldres/laravel-waitlist waitlist: add confirmed contacts per purpose, remove them on withdrawal and erasure, and carry unsubscribes made at the provider back into the waitlist via a webhook.

Taldres/laravel-waitlist

Build waitlist statistics with taldres/laravel-waitlist: signups and confirmations per day for charts, totals and confirmation rates for a period, the confirmed count on any past day, and how many people are on a list right now, for dashboards, admin pages and API endpoints.

Taldres/laravel-waitlist

Write feature tests for an application's taldres/laravel-waitlist integration: get the plain tokens from events, assert the confirmation and other mails, test the signup, confirm and unsubscribe flows in PHP and over the package's HTTP routes, and bypass rate limits and bot checks in tests.

相关技能