codewithdennis/filament-tests
Composer 安装命令:
composer require codewithdennis/filament-tests
包简介
A package that creates PEST tests specifically tailored for your filament resources
关键字:
README 文档
README
[Filament Tests] - No longer maintained. Upcoming AI tooling with proper rulesets can generate tests quickly, making this redundant.
A package that creates PEST tests specifically tailored for your Filament components.
Caution
This package is not ready yet, use it at your own risk. ⚠️
Note
This package requires that your models define model factories.
Installation
composer require codewithdennis/filament-tests --dev
Usage
Run the command to generate tests for your Filament resources:
php artisan make:filament-test
Command Options
The make:filament-test command supports the following options:
--skip-pint: Skip running Laravel Pint on generated test files--force: Overwrite existing test files without confirmation
Available Tests
This package generates comprehensive PEST tests for your Filament resources. Here's a complete list of currently working tests:
Form Record Tests
- CanCreateRecordTest - Tests that a record can be created
- CanValidateCreateFormTest - Tests that the create form validates input correctly
- Max
- Min
- Required
- CanEditRecordTest - Tests that a record can be edited
- CanValidateEditFormTest - Tests that the edit form validates input correctly
- Max
- Min
- Required
Page Rendering Tests
- CanRenderCreatePageTest - Tests that the create page renders correctly
- CanRenderEditPageTest - Tests that the edit page renders correctly
- CanRenderIndexPageTest - Tests that the index page renders correctly
- CanRenderViewPageTest - Tests that the view page renders correctly
Page Functionality Tests
- HasHeaderActionTest - Tests that header actions exist
- ShowsHeaderActionTest - Tests that a header action is visible
- HidesHeaderActionTest - Tests that a header action is hidden
Table Column Tests
- HasColumnTest - Tests that the resource has table columns defined
- CanRenderColumnTest - Tests that default visible columns render correctly
- CanNotRenderColumnTest - Tests that default hidden columns don't render
- ShowsColumnTest - Tests that explicitly visible columns are shown
- HidesColumnTest - Tests that explicitly hidden columns are hidden
- CanNotDisplayTrashedRecordsByDefault - Tests that trashed records are not displayed by default if soft deletes are enabled
- ColumnHasDescriptionBelowTest - Tests that columns with descriptions display them below
- ColumnHasDescriptionAboveTest - Tests that columns with descriptions display them above
- SelectColumnHasOptionsTest - Tests that select columns have the correct options
- ColumnHasExtraAttributesTest - Tests that columns with extra attributes render them correctly
Table Functionality Tests
- CanSearchColumnTest - Tests that searchable columns work correctly
- CanSearchColumnIndividuallyTest - Tests that individual column search works correctly
- CanSortColumnTest - Tests that sortable columns work correctly
- CanPaginateRecordsTest - Tests that pagination works correctly
Table Filter Tests
- HasFilterTest - Tests that a filter exists
Bulk Action Tests
- CanBulkDeleteRecordsTest - Tests that bulk delete action works correctly
Setup Tests
- BeforeEach - Sets up common test configuration and data
All tests are automatically generated based on your Filament resource configuration and will only run when the relevant features are present in your resource (e.g., search tests only run if you have searchable columns).
Known Issues
- Validation of RichEditor fields is not supported, this is due to the complexity of handling rich text content in tests.
Credits
License
The MIT License (MIT). Please see License File for more information.
codewithdennis/filament-tests 适用场景与选型建议
codewithdennis/filament-tests 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.69k 次下载、GitHub Stars 达 101, 最近一次更新时间为 2024 年 04 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「tests」 「laravel」 「pest」 「filamentphp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 codewithdennis/filament-tests 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 codewithdennis/filament-tests 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 codewithdennis/filament-tests 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A cli tool which generates unit tests.
Qase TMS reporter for Pest PHP testing framework
Swoole server process management
Laravel tool benchmark
A simple way to test how many files are into a given dir based on extension
A library that allows you to easily use the PHP-VCR library in your PHPUnit tests.
统计信息
- 总下载量: 8.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 101
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-04-03