refactor(tests): standardize all tests to modern PHPUnit format#33
Merged
eddmann merged 2 commits intoNov 10, 2025
Merged
Conversation
Converted all 41 test files to use modern PHPUnit 10+ syntax: - Added #[Test] attributes to 420 test methods - Renamed all test methods from testMethodName() to it_describes_behavior() - Added `use PHPUnit\Framework\Attributes\Test;` import to all test files - Maintained all test logic, assertions, and comments exactly as-is Benefits: - More readable BDD-style test names that clearly describe behavior - Consistent with modern PHPUnit best practices - Better IDE support and navigation - Improved test documentation through descriptive method names Files converted: - 5 PPU test files (ColorPalette, Color, TileRendering, ArrayFramebuffer, Ppu) - 5 Cartridge test files (Header, MBC1, MBC3, MBC5, SaveManager) - 5 APU test files (Apu, Channel1-4) - 5 CPU test files (Cpu, InstructionSet, Register8, Register16, FlagRegister) - 7 other Unit test files (BitOps, Clock, CgbController, VramBank, Savestate, Rewind, TAS) - 2 Integration test files (BlarggTestRoms, CommercialRom) Total: 413 test methods converted across 41 files Verification: - All files pass PHP syntax check (php -l) - No remaining testMethodName() format methods - All test files now use #[Test] attribute
Fixed PHPUnit errors by adding modern #[DataProvider] attributes to replace deprecated @dataProvider docblock annotations. Changes: - Added #[DataProvider] attribute to BlarggTestRomsTest - Added #[DataProvider] and #[DoesNotPerformAssertions] attributes to CommercialRomTest - Added required use statements for DataProvider and DoesNotPerformAssertions - Removed deprecated docblock annotations This fixes the following errors: - BlarggTestRomsTest::it_runs_cpu_instrs_test_rom() argument count error - CommercialRomTest::it_runs_commercial_rom_without_crashing() argument count error - CommercialRomTest::it_loads_rom_successfully() argument count error All integration tests now use modern PHPUnit 10+ attribute syntax.
eddmann
added a commit
that referenced
this pull request
Nov 10, 2025
…-011CUysu7gmVq9sFh3tmyXVX refactor(tests): standardize all tests to modern PHPUnit format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converted all 41 test files to use modern PHPUnit 10+ syntax:
use PHPUnit\Framework\Attributes\Test;import to all test filesBenefits:
Files converted:
Total: 413 test methods converted across 41 files
Verification: