/orocommerce-skills:oro-functional-testingfrom orocommerce-skills
Use when writing or debugging PHPUnit functional tests for Oro Commerce 6.1 — anything extending WebTestCase: controllers, REST API, console commands (runCommand), datagrids (requestGrid), ACL/403 flows, alice fixtures. Triggers on initClient, loadFixtures, getReference, generateBasicAuthHeader, generateApiAuthHeader, getJsonResponseContent; on @dbIsolationPerTest, @outputBuffering, @depends; on test-env setup (oro:install --env=test, install_options, .env-app.test.local, ORO_DB_DSN, --user-email ignored); on state bleed between methods or fixtures, EM clearing, InitialFixtureInterface, unit-vs-functional splits.
Ships in orocommerce-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Functional tests exercise real controllers, services, commands, APIs and ACL rules against a real database. WebTestCase boots the kernel, manages transactional isolation, loads fixtures deterministically and layers HTTP/grid/JSON helpers over BrowserKit.
/**
* @dbIsolationPerTest
* @outputBuffering enabled
*/
class DocumentControllerTest extends WebTestCase
{
protected function setUp(): void
{
$this->initClient([], $this->generateBasicAuthHeader()); // [email protected] / admin
$this->loadFixtures([LoadDocumentData::class]);
}
public function testView(): void
{
$document = $this->getReference('document.first');
$this->client->request('GET', $this->getUrl('acme_demo_document_view', ['id' => $document->getId()]));
$this->assertHtmlResponseStatusCodeEquals($this->client->getResponse(), 200);
}
}
loadFixtures() runs once per test case, resolving dependencies via DependentFixtureInterface; getReference() retrieves what a fixture registered. EM clearing: references/fixtures.md.
generateBasicAuthHeader() for HTML forms, generateApiAuthHeader($user) for the REST API — there the framework issues the token, so no password. Also loadFixtures, getReference, getContainer, runCommand, requestGrid, getJsonResponseContent, getUrl and the two status-code assertions. Signatures: references/webtestcase-helpers.md.
@dbIsolationPerTest — a transaction per method, rolled back at the end. Without it the class shares one transaction and state bleeds.@outputBuffering enabled — required on WebTestCase subclasses; strict output mode otherwise fails on any echo during request handling.@depends — inherits fixtures and state. Only for sequential scenarios where isolation would defeat the test.Same kernel, different helper and auth header:
$this->initClient([], $this->generateApiAuthHeader('[email protected]')); // REST
$result = $this->getJsonResponseContent($this->client->getResponse(), 200);
$output = $this->runCommand('oro:search:reindex', ['--class' => 'OroUserBundle:User']);
$response = $this->client->requestGrid('users-grid', ['users-grid[_filter][username][value]' => 'admin']);
runCommand needs no auth header, but still initClient(). Filter brackets: references/grid-testing.md; 403 flows: references/acl-patterns.md.
php bin/console oro:install --env=test. CLI flags such as --user-email=… are silently ignored there, so install parameters must come from oro_test_framework.install_options in config/config.yml (references/install-options.md). ORO_DB_DSN and ORO_MAILER_DSN live in .env-app.test.local.
docker compose run --rm toolbox bin/phpunit -c ./ --testsuite=functional
docker compose run --rm toolbox bin/phpunit -c ./ --testsuite=unit
Never both in one invocation — mocks from the unit suite break kernel boot and service resolution in the functional one, surfacing as service-not-found errors in unrelated tests.
@dbIsolationPerTest — one transaction per class, state bleeding between methods, order-dependent failures.--user-email=… on oro:install --env=test — silently ignored; the only supported path is oro_test_framework.install_options.InitialFixtureInterface on those that must survive.Product::class everywhere.references/: webtestcase-helpers.md (signatures) · install-options.md · fixtures.md · acl-patterns.md (HTML vs JSON 403, limited-user setup) · grid-testing.md · v6.1.md · v7.0.md
references/acl-patterns.md (opens in a new tab)references/fixtures.md (opens in a new tab)references/grid-testing.md (opens in a new tab)references/install-options.md (opens in a new tab)references/v6.1.md (opens in a new tab)references/v7.0.md (opens in a new tab)references/webtestcase-helpers.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
orocommerce@netresearch-claude-code-marketplace is listed by netresearch/claude-code-marketplace — review the source before installing
npx claudepluginhub netresearch/claude-code-marketplace --plugin orocommerce14 skills in this plugin
/oro-apiUse when exposing OroCommerce v6.1 entities via REST API, configuring api.yml or api_frontend.yml, creating custom API processors, setting up filters/sorters/subresources, or working with JSON:API endpoints. Relevant when the user mentions 'API endpoint', 'expose entity via API', 'api.yml', 'REST API', 'JSON:API', 'storefront API', or 'API processor'./oro-behat-ciUse when running Oro Commerce 6.1 Behat tests in CI/CD — Jenkins (Oro's canonical platform), GitLab CI (community territory per oroinc/platform#954), or any Docker pipeline. Covers compose fanout, headless Chrome, the formatter combo, consumer parallelisation maths, artifacts and init-image state transfer. Also on sight of .gitlab-ci.yml, Jenkinsfile, compose behat stages, compose-common.yaml. Triggers on 'behat ci', 'gitlab ci oro', 'jenkins oro', 'parallel behat', 'chrome headless', 'init-test image', 'behat hang'./oro-behat-debugging