# Run all integrity tests (recommended)
cd tests/unit && ../../vendor/bin/phpunit --testsuite Integrity --testdox
# Run from project root
./vendor/bin/phpunit -c tests/unit/phpunit.xml.dist --testsuite Integrity --testdox
# Quick check (no formatting)
cd tests/unit && ../../vendor/bin/phpunit --testsuite Integritycd tests/unit
../../vendor/bin/phpunit --testsuite IntegrityExpected output:
Tests: 17, Assertions: 19, Skipped: 2
Time: ~0.04 seconds
cd tests/unit
../../vendor/bin/phpunit --testsuite Integrity --testdoxShows:
- Test passed
- Test failed
- Test skipped
cd tests/unit
# Config Structure Tests (4 tests)
../../vendor/bin/phpunit ../../src/Test/Integrity/Testsuite/ConfigStructureTest.php
# Patch File Naming Tests (2 tests)
../../vendor/bin/phpunit ../../src/Test/Integrity/Testsuite/PatchFileNamingTest.php
# Patches Directory Tests (4 tests)
../../vendor/bin/phpunit ../../src/Test/Integrity/Testsuite/PatchesDirectoryTest.php
# Supported Versions Tests (7 tests)
../../vendor/bin/phpunit ../../src/Test/Integrity/Testsuite/SupportedVersionsTest.phpcd tests/unit
# Test patches.json structure
../../vendor/bin/phpunit --filter testPatchesJsonStructure
# Test file existence
../../vendor/bin/phpunit --filter testAllReferencedPatchFilesExist
# Test version constraints
../../vendor/bin/phpunit --filter testVersionConstraintsAreValid
# Test naming conventions
../../vendor/bin/phpunit --filter testPatchFileNamingConventionscd tests/unit
../../vendor/bin/phpunit --testsuite Integrity --list-testsOutput: List of all 17 tests
cd tests/unit
../../vendor/bin/phpunit --testsuite Integrity --colors=alwayscd tests/unit
../../vendor/bin/phpunit --testsuite Integrity --debugShows: Detailed execution information
cd tests/unit
../../vendor/bin/phpunit --testsuite Integrity --stop-on-failureUseful for: Fixing errors one at a time
cd tests/unit
../../vendor/bin/phpunitRuns: Both Unit and Integrity test suites
cd tests/unit
../../vendor/bin/phpunit --testsuite Integrity --coverage-html ../../var/coverageView report:
open ../../var/coverage/index.htmlTest passed successfully
Test failed
Test skipped (usually a warning, not a failure)
Deprecation notice (can be ignored for now)
# Quick validation
cd tests/unit && ../../vendor/bin/phpunit --testsuite Integrity# Validate JSON structure
cd tests/unit && ../../vendor/bin/phpunit --filter ConfigStructureTest# Check file exists and naming is correct
cd tests/unit && ../../vendor/bin/phpunit --filter testAllReferencedPatchFilesExist
cd tests/unit && ../../vendor/bin/phpunit --filter testPatchFileNamingConventions# Validate semver constraints
cd tests/unit && ../../vendor/bin/phpunit --filter testVersionConstraintsAreValid# From project root - all tests with pretty output
./vendor/bin/phpunit -c tests/unit/phpunit.xml.dist --testsuite Integrity --testdox
# From project root - quick check
./vendor/bin/phpunit -c tests/unit/phpunit.xml.dist --testsuite Integrity
# From project root - specific test
./vendor/bin/phpunit -c tests/unit/phpunit.xml.dist --filter testPatchesJsonStructure
# From tests/unit directory - most common
cd tests/unit && ../../vendor/bin/phpunit --testsuite Integrity --testdoxSolution: Make sure you're in the correct directory
cd /opt/homebrew/var/www/magento-cloud-patches/tests/unitSolution: Check the testsuite name (case-sensitive)
../../vendor/bin/phpunit --testsuite Integrity # Correct
../../vendor/bin/phpunit --testsuite integrity # WrongSolution: Run composer install
cd /opt/homebrew/var/www/magento-cloud-patches
composer install- PHP 8.1 or higher
- Composer dependencies installed
- No Docker required
- No Magento installation required
Integrity Tests:
- 17 tests total
- ~0.04 seconds execution time
- Minimal memory usage (~8 MB)
| Command | Purpose | Speed |
|---|---|---|
--testsuite Integrity |
All integrity tests | Fast |
--testdox |
Pretty output | Fast |
--filter <name> |
Specific test | Very fast |
--list-tests |
Show available tests | Very fast |
--debug |
Verbose output | Fast |
--stop-on-failure |
Stop on first error | Fast |
--coverage-html |
Coverage report | Slow |
- patches.json is valid JSON
- JSON has correct structure
- All referenced files exist
- Version constraints are valid semver
- Files follow naming conventions
- No duplicate references (warning only)
- patches/ directory exists
- Directory contains patch files
- All files are referenced
- File quality checks (warning only)
- Covers Magento 2.4.4+
- Covers PHP 8.1+ versions
- Major versions: 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8
Pro Tip: Add this to your bash/zsh aliases for quick access:
# Add to ~/.bashrc or ~/.zshrc
alias integrity='cd tests/unit && ../../vendor/bin/phpunit --testsuite Integrity --testdox'
# Usage:
cd /opt/homebrew/var/www/magento-cloud-patches
integrity