Главная
Study mode:
on
1
Intro
2
What is legacy code?
3
What is refactoring?
4
What is unit testing?
5
Why would I unit test?
6
A solution
7
A better solution
8
PHPUnit - installation
9
Anatomy of a unit test
10
Running the tests
11
Mocking - Caution!
12
Mockery - Installation
13
Mockery - Usage
14
A method that echoes
15
A static method call
16
Testing: hard-coded dependencies
17
Refactoring hard-coded dependencies
18
A hard-coded dependency
19
Refactoring Redirections
20
Refactoring Exiting
21
Refactoring: Updating a file
22
Fake filesystem
23
Testing: Spaghetti Code
24
Private methods
25
Time for a recap...
Description:
Explore safe refactoring techniques for legacy PHP code in this 40-minute conference talk from PHP UK 2020. Learn how to make untestable code testable without breaking existing functionality. Dive into unit testing concepts, PHPUnit installation, and test anatomy. Discover mocking strategies using Mockery, and tackle common challenges like hard-coded dependencies, redirections, and exiting. Master techniques for refactoring spaghetti code and private methods. Gain practical insights to confidently update and maintain legacy PHP projects while ensuring code integrity and reliability.

Testing Legacy Code - Safe Refactoring

PHP UK Conference
Add to list