用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/krayin/agent-skills --skill pest-testing-krayin-crm命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | Pest Testing (Krayin CRM) |
| description | Tests Krayin CRM using the Pest PHP framework (v2) with Laravel 10. |
| license | MIT |
| metadata | {"author":"webkul"} |
Activate this skill when:
Krayin tests are stored in the root tests/ directory:
/tests
├── Feature/
├── Unit/
├── Pest.php
├── TestCase.php
└── CreatesApplication.php
Defined in phpunit.xml:
| Test Suite | Location | Command |
|---|---|---|
| Unit | tests/Unit | php artisan test --testsuite="Unit" |
| Feature | tests/Feature | php artisan test --testsuite="Feature" |
tests/Pest.php binds the base test case for feature tests:
uses(\Tests\TestCase::class)->in('Feature');
It also defines helper functions you can reuse, such as:
getDefaultAdmin()actingAsSanctumAuthenticatedAdmin()getFirstName($fullName)php artisan test --compact
php artisan test --testsuite="Feature"
php artisan test --testsuite="Unit"
php artisan test --compact tests/Feature/ExampleTest.php
php artisan test --compact --filter=testName
php artisan make:test --pest ExampleFeatureTest
php artisan make:test --pest --unit ExampleUnitTest
it('passes basic assertion', function () {
expect(true)->toBeTrue();
});
it('returns successful response', function () {
$response = $this->get('/');
$response->assertSuccessful();
});
Prefer specific response helpers:
| Use | Instead of |
|---|---|
assertSuccessful() | assertStatus(200) |
assertNotFound() | assertStatus(404) |
assertForbidden() | assertStatus(403) |
it('has valid emails', function (string $email) {
expect($email)->toContain('@');
})->with([
'james' => 'james@krayin.com',
'john' => 'john@krayin.com',
]);
assertSuccessful() and other specific helpers--pest when creating teststests/Pest.php基于 SOC 职业分类