Test-Driven Development with PHP 8

BIRMINGHAM—MUMBAI

Test-Driven Development with PHP 8

Copyright © 2023 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Pavan Ramchandani

Publishing Product Manager: Bhavya Rao

Senior Editor: Mark D’Souza

Senior Content Development Editor: Rakhi Patel

Technical Editor: Simran Udasi

Copy Editor: Safis Editing

Project Coordinator: Manthan Patel

Proofreader: Safis Editing

Indexer: Manju Arasan

Production Designer: Roshan Kawale

Marketing Coordinator: Anamika Singh

First published: January 2023

Production reference: 1161222

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80323-075-7

www.packt.com

In the memory of my aunt Rose, who raised me, and to my family and friends. To Eva, for the unending encouragement. To my partner, Frezel Enriquez, for the love and support throughout my journey in life.

– Rainier Sarabia

Foreword

I have known and worked with Rainier Sarabia for more than 5 years. In this book, Test-Driven Development with PHP 8, Rainier takes you on a learning journey that started in the late 1990s, with not only PHP but test-driven development itself. For more than 20 years, PHP has continued to evolve to meet the needs of developers around the world. In parallel, test-driven development and agile principles have also evolved, culminating in this book combining all three to demonstrate how easily an application with frameworks, environments, and toolchains can be built rapidly, and more importantly, with rock-solid reliability.

In his presentations and examples, Rainier shows how easy it is not only to create consistently tested applications but to have consistent environments to run those tests in, no matter whether they are on your machine, a fellow developer’s machine, a cloud-based CI, or in a test environment.

With Test-Driven Development with PHP 8, you’ll learn the best practices for writing reliable, maintainable code with PHP’s object-oriented architecture. After you complete Rainier’s book, you’ll understand how to take full advantage of test-driven development in PHP.

Beyond developing apps, you’ll learn how to quickly and easily bootstrap applications in cloud services using containerized environments, giving transportability and consistency to your application.

Rainier encapsulates the knowledge gained through years as a world-class software engineer and passionate advocate. With his words, step-by-step instructions, screenshots, source code snippets, examples, and links to additional sources of information, you will learn how to continuously enhance your skills and applications.

Ben Hansen

Directory of Quality Assurance, PayGroup Ltd.

Contributors

About the author

Rainier Sarabia is a Software Engineering Manager, who currently works in Melbourne, Australia for Astute Payroll, a Deel company. He has worked on hundreds of complex software projects, including massive enterprise SaaS products while leading and training senior engineers from all over the world. His favorite programming languages are PHP, C#, Java, and Javascript which he uses for both professional and personal projects. He co-founded his first tech company back in 2014, with over 400,000 users. Outside of working hours, he is an amateur astronomer. He spends most of his time doing astrophotography focusing on deep-sky objects like nebulae and galaxies.

I want to thank the people who have been inspiring me and helping me in writing this book. I’d like to thank Eva Bellaire, Ilia Mogilevsky, and Ben Hansen for spending so much of their free time and weekends helping me with this book, I really appreciate it.

To the Packt team: Manthan Patel, Rakhi Patel, Mark D’Souza, Bhavya Rao, thank you so much for your patience and guidance, I’ve learned so much from you!

My mates from Exsentriks: Jan Albee Angeles, Joms Calma, Blink Easley, Randy Porcioncula, Vincent Rafols, William Dela Pena, and Richard Coles, thanks so much for the support and ideas I always love and enjoy our C#, PHP, Java, and Javascript discussions!

For the past 6 years, Astute Payroll, and PayGroup have been very supportive of me and my ideas! To Luke Zawadzki, thank you so much for all the help and guidance, mate! I’d also like to thank, Eloise Roberts, Sally Laycock, Mahin Sonia, Johnny Yu, Trang Dinh, Adi Setiono, Tadek Chavez, Marcus Webb, Shelley Mackie, Nicole Poulton, Adam Perks, Paul Radford, Rudy Compayan, Joyce Orevillo, Tao Ding, Tim Evetts, Julian Calaby, Mac Wilgucki, Tim Malone, Ginli Chew, Mitch Collins, Trish Scally, and Rick Measham. And I’d also like to thank Adam Parrish, Andrew Sekula, and Vik Radha for the great table tennis battles we had in MIM! Lastly, I also want to thank Erin Jan Gandia, Oleg Posternatsky, Matteo Bortolu, Dexter Naag, and Andre Bellaire for all the support.

About the reviewers

Ben Hansen has been a QA professional his entire IT career, starting as a purely manual tester, then learning and working up to automation testing, QA lead, and now QA director overseeing large international teams. Specializing in various CRM, accounting, and payroll applications, he has pioneered many testing techniques and technologies, reducing testing times from months to weeks for features in some applications while increasing quality.  

Eva Bellaire is a CPA-qualified leader who has worked in multiple positions in accounting and project delivery with both agile and waterfall methods. Her experience includes management and oversight of projects for organizations in a diverse set of industries including mining and engineering, professional services, higher education, and financial services. She is experienced in enterprise transformation and technology enablement across finance, planning, payroll, HR, and analytics software. She has a passion for continuous learning as well as mentoring and people development.  

Ilia Mogilevsky is a Ukrainian-born Jewish immigrant who is currently leaving in Melbourne, Australia, with his beautiful wife, two young inquisitive children, and his always playful golden retriever, Daisy. He is an industry-certified professional with over 20 years of full-time commercial experience as a code wrangler, technical lead, solutions architect, and engineering manager. Ilia has worked in various areas of software engineering, ranging from big digital agencies such as Next Digital, massive B2B and B2C companies such as Hanes Australasia (Bonds, Sheridan, Berlei, Champion), and small start-ups such as Combitel, where he helped develop a data-driven web-based application for IPTV streaming. As of 2022, he is currently employed at SmartBear as an engineering manager, working with the PactFlow team to help engineers all over the world build more robust testable software. In recent years, he turned his passion for technology with a wide breadth of software engineering knowledge, skills, and experiences to helping businesses achieve their critical goals by building successful technology-centric teams and continuously cultivating his growth mindset while helping and supporting his peers through mentoring, coaching, and best practices.

In his spare time, he loves to travel with his family and has become a keen landscape photographer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset