Testable Database Interaction

Testable Database Interaction

Designing software systems and writing code is much easier when you do not have to process input, produce output, or interact with other systems such as database servers. It would also be pretty boring.

In this presentation, you will learn best practices and see design patterns in action that allow you to interact with your database without going crazy. In other words: you will learn how to implement testable database interaction and how to test it.

I most recently presented "Testable Database Interaction" at the International PHP Conference on .

About me

My name is Sebastian Bergmann and I am the creator of PHPUnit, the industry-standard testing framework that has greatly improved the professionalism of PHP software development.

As founding partner of and consultant with The PHP Consulting Company (thePHP.cc), I assist teams in adopting PHPUnit, optimizing its use, refining development workflows, and writing more testable code.

More events where you can meet me are listed here.

My interactive online training courses are designed to provide you with practical knowledge that you can apply immediately. The next ones starting soon are listed here.

Related presentations

This presentation is part of a series in which I explore best practices for writing testable code and demonstrate effective techniques for testing it.

The common theme of "Testing with(out) dependencies", "Testable Database Interaction", and "Event-Based Testing" is the development of testable code and the effective use of test doubles to isolate dependencies in testing. Each presentation covers best practices for testing complex software architectures by demonstrating when and how to replace real dependencies with test stubs or mock objects to ensure reliable and maintainable tests.

Upcoming events

Stay up to date with PHPUnit

You can follow @phpunit@phpc.social to stay up to date with PHPUnit's development.

You can subscribe to the PHPUnit Updates newsletter to receive updates about and tips for PHPUnit.