This repository is a collection of classic and creative code katas implemented in PHP using PHPUnit — the testing framework that also powers Pest. These katas serve as exercises to improve your problem-solving, TDD workflow, and deepen your understanding of PHP testing principles.
- Practice Test-Driven Development (TDD)
- Build strong habits in clean coding and refactoring
- Explore how PHPUnit supports reliable, testable code
- Lay the groundwork for adopting Pest, built on top of PHPUnit
| Kata | Description |
|---|---|
GildedRose |
Refactor a legacy inventory system with evolving requirements |
QUIZ |
Logic-based kata to reinforce conditionals and flow control |
SubscribeFunction |
Functional implementation of a dynamic subscribe mechanism |
TennisMatch |
Simulates the scoring system of a tennis game |
FizzBuzz |
Classic introductory kata for TDD and control logic |
PrimeFactors |
Decompose numbers into their prime factors |
RomanNumerical |
Convert integers to Roman numerals |
Song: No More Beers |
Prints verses of a countdown-style song ("No more beers on the table") |
StringCalculator |
Parse and sum up numbers in a string input |
TagParser |
Extract and structure custom tags from text |
- PHP 8.1+
- PHPUnit – Core testing framework used throughout
- (Pest not used directly, but this repo demonstrates the foundation Pest is built on)
- Clone the repository
git clone https://github.com/blackjack465/CodeKatas.git
cd CodeKatas