testing

Write OrangeHRM PHP, Jest, and Cypress tests with YAML fixtures and base class conventions.

1.1k|746|Updated Jan 5, 2017
One-click install
npx skills add https://github.com/orangehrm/orangehrm --skill testing-orangehrm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/orangehrm/orangehrm/tree/main/.agents/skills/testing
Command: npx skills add https://github.com/orangehrm/orangehrm --skill testing-orangehrm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the frustration of navigating OrangeHRM's fragmented testing ecosystem, guessing which test base class to use, misconfiguring the test database, and debugging opaque CI test failures that don't reproduce locally.

Core Features & Use Cases

  • PHPUnit Test Guidance: Covers per-plugin testsuites, test base classes (TestCase, KernelTestCase, EndpointTestCase), YAML fixture patterns, and DAO/service/endpoint test conventions for consistent, maintainable backend tests.
  • Cross-Layer Testing Support: Includes setup and usage guidance for Jest frontend unit tests and Cypress end-to-end tests to validate full user journeys.
  • Test Environment & Debugging Helpers: Provides step-by-step instructions for creating the test DB, running targeted test suites, and resolving common issues like version mismatches between local and CI environments, strict error mode failures, and fixture data conflicts.
  • Use Case: If you are adding a new DAO method to the Admin plugin, this skill tells you exactly which base class to extend, how to structure your YAML fixture, and how to run the test locally and in CI without configuration guesswork.

Quick Start

Use the testing skill to write a compliant DAO test for a new OrangeHRM data access method, following the project's YAML fixture and base class conventions.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I write a PHPUnit DAO test for a new OrangeHRM plugin?

To write a PHPUnit DAO test for OrangeHRM, extend the correct test base class, structure a YAML fixture for test data, and follow the project's per-plugin testsuite conventions to ensure compliance and maintainability.

Which test base class should I use for OrangeHRM API endpoint tests?

For OrangeHRM API endpoint tests, use EndpointTestCase to ensure proper request handling and response validation, while TestCase and KernelTestCase support DAO and service layer testing respectively.

How do I set up the test database for OrangeHRM PHPUnit tests?

Setting up the test database for OrangeHRM involves following step-by-step creation instructions to configure the test DB lifecycle, which prevents fixture data conflicts and ensures local tests reproduce CI behavior accurately.

Can I use Jest and Cypress for OrangeHRM frontend and end-to-end testing?

Yes, you can use Jest for frontend unit tests and Cypress for end-to-end tests in OrangeHRM to validate full user journeys, with setup and usage guidance provided for configuring test runs correctly.

Why do my OrangeHRM CI test failures not reproduce locally?

OrangeHRM CI test failures often stem from version mismatches between local and CI environments, strict error mode failures, or fixture data conflicts, which can be resolved by following targeted debugging helpers.