
Автор: Flávio Gomes da Silva Lisboa
Издательство: BPB Publications
Год: 2025
Страниц: 440
Язык: английский
Формат: True/Retail EPUB
Размер: 10.1 MB
In today's fast-paced development landscape, ensuring code quality and bug-free software through testing is essential. This book is your practical guide to mastering test-driven development (TDD) in the PHP 8 ecosystem, empowering you to write better code from the very beginning. Embark on a structured learning journey, starting with setting up your PHP 8 testing environment and understanding the core principles of TDD using PHPUnit and Composer. You will then learn about writing tests for fundamental PHP concepts, including functions, file system operations, array handling, and web interactions like forms and sessions. Through the practical exercise of building a book registration application, you will learn to apply TDD with different data storage solutions, from simple file systems to relational databases (MySQL) and document databases (MongoDB). Progressing further, you will discover how to implement TDD in object-oriented PHP 8, covering design patterns, database interactions with PDO, API development, etc. This book is for PHP developers, including beginners with basic PHP syntax knowledge, and intermediate developers seeking to adopt TDD and improve their application architecture. Familiarity with fundamental web development concepts will be beneficial for understanding the practical examples.