用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mglaman/phpstan-drupal --skill gen-test命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | gen-test |
| description | Generate a PHPStan rule test class and fixture data file |
| disable-model-invocation | true |
| arguments | [{"name":"rule_class","description":"Fully qualified class name of the rule to test (e.g. mglaman\\PHPStanDrupal\\Rules\\Drupal\\EntityQuery\\EntityQueryHasAccessCheckRule)"}] |
Create a test class and fixture file for a PHPStan rule in this project.
Rules\Classes\ -> tests/src/Rules/Rules\Deprecations\ -> tests/src/Rules/Rules\Drupal\ -> tests/src/Rules/Rules\Drush\ -> tests/src/Rules/Type\ -> tests/src/Type/mglaman\PHPStanDrupal\Tests\DrupalRuleTestCasedeclare(strict_types=1) at the topfinalgetRule() returning an instance of the rule@dataProvider cases with a generator[files, errors] where errors are [message, line, tip?]tests/src/Rules/data/ or tests/src/Type/data/php vendor/bin/phpunit --filter=TheNewTestClass to verify<?php
declare(strict_types=1);
namespace mglaman\PHPStanDrupal\Tests\Rules;
use mglaman\PHPStanDrupal\Rules\Drupal\ExampleRule;
use mglaman\PHPStanDrupal\Tests\DrupalRuleTestCase;
final class ExampleRuleTest extends DrupalRuleTestCase
{
protected function getRule(): \PHPStan\Rules\Rule
{
return new ExampleRule();
}
/**
* @dataProvider cases
*
* @param list<array{0: string, 1: int, 2?: string|null}> $errors
*/
public function test(array $files, array $errors): void
{
$this->analyse($files, $errors);
}
public static {
=> [
[ . ],
[],
];
=> [
[ . ],
[
[, ],
],
];
}
}