PHP Classes

File: TESTING.md

Recommend this page to a friend!
  Packages of ?????? ???????   Adaptive Entity Manager   TESTING.md   Download  
File: TESTING.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: Adaptive Entity Manager
Entity manager to work with multiple data sources
Author: By
Last change:
Date: 3 months ago
Size: 1,768 bytes
 

 

Contents

Class file image Download

Testing Guide

Available Test Commands

This project includes several composer scripts for different testing scenarios:

Basic Commands

# Run all tests
composer test

# Check PHP syntax in all files
composer test:syntax

# Quick test: syntax check + all tests
composer test:quick

Test Suites

# Run only unit tests
composer test:unit

# Run only integration tests  
composer test:integration

# Run only metadata tests (our new caching system)
composer test -- --testsuite metadata

Coverage Reports

# Generate HTML coverage report
composer test:coverage

# Generate unit test coverage
composer test:unit:coverage

Utility Commands

# Install development dependencies
composer install:dev

# Clear cache directories
composer cache:clear

Test Structure

  • `tests/Unit/` - Unit tests
  • `tests/Integration/` - Integration tests
  • `tests/Metadata/` - Metadata caching system tests
  • `tests/Mock/` - Mock objects and test fixtures

Development Workflow

  1. Before committing changes:
    composer test:syntax
    composer test -- --testsuite metadata
    
  2. Full test run:
    composer test
    
  3. Generate coverage:
    composer test:coverage
    # Open coverage/index.html in browser
    

New Metadata Caching Tests

Our new caching system tests can be run specifically with:

composer test -- --testsuite metadata

These tests verify: - Multi-level caching (runtime + persistent) - Cache invalidation - PSR-6 compatibility - Performance optimizations

CI/CD Integration

For continuous integration, use:

composer test:syntax && composer test

This ensures both syntax correctness and functional tests pass.