O'Reilly logo

PHPUnit Essentials by Zdenek Machek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Doctrine 2 ORM and database testing

When you are working on a modern application, you almost use a database abstraction layer. As an example of how to use DBUnit with a third-party library, let's have a look at how to use Doctrine 2 ORM, which is a heavyweight but very powerful object-relational mapper using our own Database Abstraction Layer (DAL). Doctrine is quite complex, and the aim is not to explain how it works, but to show you how to use database integration testing with other database abstraction layers.

To be able to run code, you have to install the required libraries. In this case, it is strongly suggested that you use the Composer installation and a class loader to install Doctrine by setting the required dependency in the composer.json ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required