This is the PHP code base to use when attending my introduction to TDD workshop
As a group we will implement a String Stack (First In, Last Out - FILO) that will conform to the Collection Interface.
In pairs you will implement a String Queue (First In, First Out - FIFO) that will conform to the Collection Interface.
As a group we will implement a Simple Application that conforms to the Till Interface to calculate the total cost of a basket based on the lunch time meal deal
- Sandwich £2.00
- Drink £0.90
- Crisps £0.50
- Sandwich, Drink & Crisp £3.00
In pairs you will continue to implement the Till Interface to calculate the total cost of a basket based on Baked Beans and Spaghetti Hoop offers
-
Baked Beans £0.75
-
Spaghetti Hoops £0.80
-
Baked Beans Offer: Buy One Get One Free (BOGOF)
- 2 * Baked Beans = £0.75
- 3 * Baked Beans = £1.50
-
Spaghetti Hoop Offer: Buy Two Get Third Half Price (BTGTHP)
- 2 * Spaghetti Hoops = £1.60
- 3 * Spaghetti Hoops = £2.00
- 4 * Spaghetti Hoops = £2.80
As a group we will implement the Ledger Interface using the London / Interaction style of testing
As a group we will implement the Ledger Interface using the Chicago / State style of testing
In Pairs you need to implement Logger Interface that uses an SplFileObject using the London / Interaction style of testing
Note: When creating the mock of SplFileObject the mock requires you give the first constructor argument.
See Example:
$file = \Mockery::mock(\SplFileObject::class, ['/dev/null']);
In Pairs you need to implement Logger Interface that uses an SplFileObject using the Chicago / State style of testing
Note: the exec may be helpful for setup and assertions
Demonstrating how Infection a PHP mutation testing library can be used ensure tests full
Demonstrating how to change the tests when the requirements change.