Workshop in English - US at php[world] 2019
View Slides: https://stevegrunwell.com/slides/intro-to-testing-workshop
Checkout the code: https://github.com/stevegrunwell/pupper
Short URL: https://joind.in/talk/45264 (QR-Code (opens in new window))
A separate ticket is required to attend this full-day training taking place Oct 22nd (the day before the conference) - https://world.phparch.com/register
Testing software in an automated fashion is one of the best ways to guarantee the quality, reduce bugs, and prevent regressions in our code, and is a prerequisite to operating in a Continuous Integration environment. Unfortunately, the most difficult parts of testing come right at the beginning: scaffolding a test suite and writing our very first tests. For those who are new to automated testing, these hurdles can prove overwhelming.
This training Talk covers the fundamentals of testing, in a beginner-friendly way. We'll discuss how testing makes software better, the various levels of the Automation Pyramid, and discuss the characteristics of great tests. Then, we'll dive into a real application to write tests to support legacy code, practice TDD while developing a new feature, and using tests to help prevent regressions with our bugfixes.
### Prerequisites & Assumptions:
It's assumed that attendees will have access to a computer with the ability to install a Laravel Homestead Vagrant environment (see https://laravel.com/docs/master/homestead).
The application we'll be working on comes bundled with all of the necessary dependencies (including current versions of PHP, Node.js, PostgreSQL, etc.) in the virtual machine, but the host machine should have:
* Git (https://git-scm.com/downloads)
* Composer (https://getcomposer.org/download)
* Vagrant (https://vagrantup.com)
* One or more of the virtualization platforms supported by Laravel Homestead (https://laravel.com/docs/master/homestead#installation-and-setup)
### Learning Objectives:
1. Establish a good understanding of how well-written tests can produce more stable, manageable code
2. Familiarize attendees with the most common features of PHPUnit, along with test organization and execution strategies
3. Provide a real, working application that attendees may use to practice writing tests in common scenarios, including:
- Writing tests around legacy code
- Practicing Test-Driven Development (TDD) in building new features
- Writing regression tests to effectively squash bugs
At the end of the course, attendees will be confident in contributing to (or even starting) the automated test suite for a PHP application.
Attendees will understand what, when, where, and how to test in a way that benefits the application without being overly rigid/brittle.
Furthermore, they will leave with a fully-functional copy of our application, bundled with a well-documented, Laravel Homestead-powered development environment.