用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/G1Joshi/Agent-Skills --skill phpunit命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | phpunit |
| description | PHPUnit PHP testing framework. Use for PHP testing. |
PHPUnit is the standard unit testing framework for the PHP ecosystem. Examples include usage in Laravel, Symfony, and WordPress.
<?php
use PHPUnit\Framework\TestCase;
final class StackTest extends TestCase
{
public function testPushAndPop(): void
{
$stack = [];
$this->assertEmpty($stack);
array_push($stack, 'foo');
$this->assertNotEmpty($stack);
$this->assertEquals('foo', array_pop($stack));
}
}
Methods like $this->assertTrue(), $this->assertSame(), $this->expectException().
PHPUnit gives you control over the behavior of dependencies.
$stub = $this->createMock(SomeClass::class);
$stub->method('doSomething')->willReturn('foo');
$this->assertEquals('foo', $stub->doSomething());
Pass data to a test method (similar to parameterized tests).
#[DataProvider('additionProvider')]
public function testAdd(int $a, int $b, int $expected): void { ... }
Do:
$this->assertSame() checks types (===), whereas assertEquals is loose (==). Strict is safer.Tests\Unit\UserTest matching App\Models\User.#[Test] instead of /** @test */ annotations if on PHP 8.2+.Don't: