Testing
Konten ini belum tersedia dalam bahasa Anda.
Install the development dependencies in a source checkout and record the installed versions:
composer installcomposer validate --strictcomposer auditcomposer show yiisoft/yii2vendor/bin/phpstan --versionThe library’s lockfile is ignored; CI resolves dependencies for Yii 2.0.55 and Yii 22 on PHP 8.3, 8.4 and 8.5. Static analysis targets PHP 8.3 and runs on PHP 8.3 and 8.5 in CI.
Package checks
Section titled “Package checks”composer testscomposer staticvendor/bin/phpstan analyse -c phpstan-console.neon --memory-limit=1Gcomposer check-dependenciesvendor/bin/ecs checkPHPUnit compares inferred types through PHPStan\Testing\TypeInferenceTestCase, including configuration and cache
dependency cases. Both static configurations matter because Yii::$app has one configured application type per
analysis. composer ecs applies fixes and composer rector refactors files; use them only for intentional changes
and inspect their diffs.
The logger resolver looks up the optional Yii 22 yii\log\PsrMessage class by name and checks for it through
reflection before including it. The test bootstrap defines the expected payload type for the installed Yii version,
so PHPUnit and direct static checks validate the same fixture on Yii 2.0.55 and Yii 22. Retain the existence guard
and both sets of expectations when changing logger inference.
When checking an isolated consumer, preserve its composer.json and configured vendor directory together. PHPStan
uses that manifest to recognize dependency stubs; copying only the vendor tree can trigger project-stub validation.
Verify documented application setups
Section titled “Verify documented application setups”Adapt the usage recipes to the application and inspect the affected types. Run both Web and console analyses when relevant, and verify runtime behavior attachments or database/HTTP integration when they change.
Documentation quality
Section titled “Documentation quality”The pinned reusable workflow in .github/workflows/quality.yml runs Prettier 3.8.4, EditorConfig Checker 3.7.0 and
Markdownlint CLI2 0.22.1. Use its repository configurations together:
npx prettier@3.8.4 --check --config .prettierrc.json --ignore-path .prettierignore '**/*.md' '**/*.{yml,yaml}'editorconfig-checker -config .github/linters/.editorconfig-checker.jsonnpx markdownlint-cli2@0.22.1 --config .github/linters/.markdown-lint.yml '**/*.md' '#vendor/**' '#runtime/**'Check changed files and relative links. Use headings or bullets when numbered-list continuations conflict with EditorConfig indentation. For client discovery and activation, see AI assistance.