- Deciding what features to use
- Building first Feature test, end to end test.
- Running first test
- setting up sqlite in memory DB
- Unit testing the Concert model
- Refactoring Code while keeping tests passing
- Add more features to the Feature Test
- Refactoring Controller using Concert Unit testing
- Applying Model factory states to create more readable tests
Remember to refactor test names as code develops to be more descriptive of the test as the test set builds up
- Pros on cons of end to end browser and ened to end point Testig
- Setting up payment Test
- Using a fake to mock a third party appliction
- Create ConcertOrders Controller and test driving first order create. Migrations for Orders and Tickets tables + relationships created
- Add test for json request validation and refactoring of the ConcertOrdersController
- Add more test for request validation. Interesting ideas for testing different validation rule replies using the assertArrayKey and the Json Decode method. See PurchaseTicketsTest
- Refactoring the PurchaseTicketsTest to be more expressive, using helper functions to wrap commonly used items such as the post request made. The assertions wee also encapsulated. This is a great technique for creating more readable test.
- Shows way of using try catch to assert tests past rather than using @exception notation in doc blocks of the test. This method allows for further assertions to be made on the exception however this is not shown in this video, only discussed. A custom Exception handler is created and try catch blocks added to the controller to throw new exception. This is then tested for.
- The test were updated to hand published and unpublished concerts with a test to see that unpublished concerts couldn't have tickets bought for them. The controller method for storing the ticket methods has been updated to prioritise exceptions as several exceptions can be thrown in that controller.