magento-test

Generate Magento 2 PHPUnit unit and integration tests with typed mocks.

32|3|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/furan917/magento-ai-toolkit --skill magento-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: magento-test
Source: https://github.com/furan917/magento-ai-toolkit/tree/main/skills/magento-test
Command: npx skills add https://github.com/furan917/magento-ai-toolkit --skill magento-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generating Magento 2 unit and integration tests can be time-consuming and error-prone; this Skill automates creation of PHPUnit tests that follow Magento conventions, reducing boilerplate and ensuring consistent coverage.

Core Features & Use Cases

  • Generates unit tests in app/code/Vendor/Module/Test/Unit/ and integration tests in dev/tests/integration/ for Magento 2 modules.
  • Enforces Magento conventions: declare(strict_types=1), typed mocks, descriptive test method names, and fixture-based data setup.
  • Use Case: When adding a new Model or Plugin, generate comprehensive PHPUnit tests to validate behavior and integration with the object manager.

Quick Start

Describe the class or method you want to test to generate PHPUnit tests that follow Magento conventions.

Frequently Asked Questions about magento-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Magento 2 PHPUnit tests that follow standard conventions?

Magento 2 PHPUnit test generation enforces conventions like declare(strict_types=1), typed mocks, and descriptive names. It creates unit tests in Test/Unit/ and integration tests in dev/tests/integration/ for modules, reducing boilerplate.

What's the best way to create Magento 2 integration tests for plugins and observers?

Magento 2 integration tests for plugins and observers validate behavior with the object manager. The generator places tests in dev/tests/integration/ and provides guidance for fixtures, bootstrap, and data isolation.

Does this Magento 2 test generator support unit testing for models and services?

Yes, Magento 2 unit testing supports models and services by generating tests in app/code/Vendor/Module/Test/Unit/. It uses typed mocks and fixture-based data setup to validate module behavior consistently.

How do PHPUnit typed mocks work in Magento 2 testing conventions?

PHPUnit typed mocks in Magento 2 testing ensure type safety by enforcing declare(strict_types=1) and using descriptive test method names. This approach validates module behavior while reducing boilerplate and maintaining consistent coverage.

Can I use this to generate tests for both unit and integration scenarios in Magento 2?

Yes, you can generate Magento 2 PHPUnit tests for both unit and integration scenarios. Unit tests go in app/code/Vendor/Module/Test/Unit/ and integration tests in dev/tests/integration/, covering models, services, plugins, and observers.