magento-test

magento-test is a skill for Claude Code, Codex from furan917/magento-ai-toolkit. It costs 29 tokens per session (2,412 once invoked), scanned A, original, MPL-2.0.

A test-writing guide for Magento 2, an e-commerce platform, using PHPUnit, a PHP testing framework.

In plain words
What is it for?
Use it to create unit and integration tests for models, services, plugins, and observers, with or without a database.
Why use it?
It helps verify that Magento code works correctly and keeps tests in the project locations Magento expects.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to create unit and integration tests for models, services, plugins, and observers, with or without a database.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/furan917/magento-ai-toolkit/magento-test
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add furan917/magento-ai-toolkit --skill magento-test
Clone the repo
git clone --depth 1 https://github.com/furan917/magento-ai-toolkit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for magento-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-test/github.svg)](https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-test)
Your own site
<a href="https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-test"><img src="https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-test/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for magento-test

Your own site · 80×15
<a href="https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-test"><img src="https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,412 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.02412
Opus 5.5 $0.00012 $0.00965
Sonnet 5.5 $0.00006 $0.00482
Haiku 4.5 $0.00003 $0.00241

Measured 2mo ago against content hash 8da8b068b3b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

magento-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/magento-test/SKILL.md · 303 lines

How it starts

The opening of the file, as written. The whole thing — 303 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: magento-test

Purpose: Generate Magento 2 unit and integration tests using PHPUnit. Compatible with: Any LLM (Claude, GPT, Gemini, local models) Usage: Paste this file as a system prompt, then describe the class or method you want to test.


System Prompt

You are a Magento 2 testing specialist. You write PHPUnit tests that follow Magento conventions — unit tests with mocks in Test/Unit/, integration tests using Bootstrap::getObjectManager() in dev/tests/integration/. You always use declare(strict_types=1), typed mocks, and descriptive test method names.


Test Types Reference

Type Location Command Needs DB?
Unit app/code/Vendor/Module/Test/Unit/ vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist No
Integration dev/tests/integration/ vendor/bin/phpunit -c dev/tests/integration/phpunit.xml.dist Yes
API Functional dev/tests/api-functional/ vendor/bin/phpunit -c dev/tests/api-functional/phpunit.xml Yes
Static dev/tests/static/ vendor/bin/phpunit -c dev/tests/static/phpunit.xml.dist No
MFTF (E2E) dev/tests/acceptance/ vendor/bin/mftf run:test TestName Yes

Unit Test — Test/Unit/Model/ServiceTest.php

<?php
declare(strict_types=1);

namespace Vendor\Module\Test\Unit\Model;

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Vendor\Module\Model\Service;
use Vendor\Module\Api\Data\EntityInterface;

class ServiceTest extends TestCase
{
    private Service $service;
    private LoggerInterface&MockObject $loggerMock;

    protected function setUp(): void
    {
        $this->loggerMock = $this->createMock(LoggerInterface::class);
        $this->service    = new Service($this->loggerMock);
    }

    public function testProcessReturnsResult(): void
    {
        $entityMock = $this->createMock(EntityInterface::class);
        $entityMock->method('getName')->willReturn('Test Entity');

        $result = $this->service->process($entityMock);

        $this->assertNotNull($result);
        $this->assertSame('Test Entity', $result->getName());
    }

    public function testProcessLogsError(): void
    {
        $entityMock = $this->createMock(EntityInterface::class);
        $entityMock->method('getName')->willReturn('');

        $this->loggerMock
            ->expects($this->once())
            ->method('error')
            ->with($this->stringContains('empty name'));

        $this->service->process($entityMock);
    }

    public function testProcessThrowsOnInvalidInput(): void
    {
        $this->expectException(\InvalidArgumentException::class);
        $this->expectExceptionMessage('Entity cannot be null');

        $this->service->process(null);
    }

    /**
     * @dataProvider priceDataProvider
     */
    public function testFormatPrice(float $input, string $expected): void
    {
        $this->assertSame($expected, $this->service->formatPrice($input));
    }

    public static function priceDataProvider(): array
    {
        return [
            'zero'     => [0.0,    '$0.00'],
            'integer'  => [10.0,   '$10.00'],
            'decimal'  => [9.99,   '$9.99'],
            'negative' => [-5.50,  '-$5.50'],
        ];
    }
}

Read the full file on GitHub · 303 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 303 lines · 29 tokens per session scan A 8da8b068b3b3

Subscribe to this mod's changes

magento-test is a skill published in the GitHub repository furan917/magento-ai-toolkit (35 stars, last pushed 5mo ago), licensed MPL-2.0. It adds 29 tokens to every session and 2,412 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

test-master

Generates test files, creates mocking strategies, analyzes code coverage, designs test architectures, and produces test plans and defect reports across functional, performance, and security testing disciplines. Use when writing unit tests, integration tests, or E2E tests; creating test strategies or automation…

Jeffallan/claude-skills · 104 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

dotnet/skills · 149 tokens

go-testing

Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.

Gentleman-Programming/gentle-ai · 26 tokens

principle-test-behavior-not-implementation

Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when that behavior breaks and keeps passing when only the internals change.

michael-denyer/pstack-claude · 50 tokens

dart-test

DART Test: unit tests, integration tests, CI validation, and debugging.

dartsim/dart · 18 tokens

testing-llm

LLM and AI testing patterns — mock responses, evaluation with DeepEval/RAGAS, structured output validation, and agentic test patterns (generator, healer, planner). Use when testing AI features, validating LLM outputs, or building evaluation pipelines.

yonatangross/orchestkit · 55 tokens