Magento testing

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Magento testing is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Write tests for Magento 2 — PHPUnit unit tests, integration tests, MFTF functional tests, and API tests. Use when implementing test coverage for modules, debugging, or setting up CI/CD test pipelines.

How to use this skill

Skill file

Magento 2 Testing

Before writing code

Fetch live docs:

  1. Web-search site:developer.adobe.com commerce testing for testing overview
  2. Fetch https://developer.adobe.com/commerce/testing/functional-testing-framework/ for MFTF guide
  3. Web-search site:developer.adobe.com commerce php development test for unit/integration test patterns

Testing Layers

Unit Tests

Purpose: Test individual classes in isolation.

Integration Tests

Purpose: Test module interactions with the Magento framework.

MFTF (Magento Functional Testing Framework)

Purpose: End-to-end browser tests.

API Functional Tests

Purpose: Test REST and SOAP API endpoints.

Static Tests

Purpose: Code quality and standards.

Key Testing Patterns

Mocking in Magento

Test Data Fixtures

Integration tests use fixtures to set up test state:

Testing Plugins

Unit test plugin classes independently — call the plugin method with a mock subject and verify behavior.

Testing Observers

Unit test observer's execute() method with a mocked Observer/Event object.

Best Practices

Fetch the testing documentation for exact annotations, fixture patterns, and MFTF XML schema before writing tests.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.