Skip to content

Add testing guide#440

Open
samdark wants to merge 1 commit intomasterfrom
265-testing-guide
Open

Add testing guide#440
samdark wants to merge 1 commit intomasterfrom
265-testing-guide

Conversation

@samdark
Copy link
Copy Markdown
Member

@samdark samdark commented May 7, 2026

Closes #265.

Adds the testing guide section with pages for overview, environment setup, unit tests, functional tests, end-to-end tests, and static analysis with mutation testing.

Functional testing guidance uses PSR-7 requests as input and PSR-7 responses as output, without depending on a specific test framework.

Copilot AI review requested due to automatic review settings May 7, 2026 07:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Testing section to the Yii3 definitive guide, covering the main testing levels and complementary quality tools to help keep applications and packages safe to change.

Changes:

  • Introduces new testing guide pages: overview, environment setup, unit, functional, and end-to-end testing.
  • Adds guidance on static analysis and mutation testing (Psalm/PHPStan + Infection).
  • Updates the guide index to link to the new testing pages (replacing TODO entries).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/guide/testing/overview.md Introduces testing levels and guidance on choosing the smallest effective test type.
src/guide/testing/environment-setup.md Describes test environment isolation and state reset strategies.
src/guide/testing/unit.md Adds unit testing principles and a PHPUnit example.
src/guide/testing/functional.md Documents PSR-7/PSR-17 functional testing flow using Yiisoft\Yii\Http\Application.
src/guide/testing/end-to-end.md Adds end-to-end testing guidance and environment considerations.
src/guide/testing/quality-tools.md Adds static analysis and mutation testing guidance and when to run them.
src/guide/index.md Updates the Testing section links to point to the new pages.

Comment thread src/guide/testing/unit.md
Comment on lines +30 to +32
$slug = $generator->generate('Hello, Yii 3!');

self::assertSame('hello-yii-3', $slug);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Testing

2 participants