Mezzio Example: Testing Doctrine Entities and Repositories

Overview

In this post, we’ll see how to create a comprehensive testing framework for Doctrine Entities and Repositories. This is a continuation of our Mezzio Example series where we previously created our domain model for an OAuth2-enabled application.

Let’s make sure our Entities and Repositories have full test coverage. The domain model is a significant part of any dynamic application so the code should be in good shape. We don’t want any bugs here.

[Read More]

Mezzio Example: Doctrine Entities and Repositories

Overview

This post brings several pieces of supporting libraries together.

Entities to Support OAuth2 Requirements

We’ll start by defining a minimum domain model via PHP8 Attributes and Doctrine’s new attribute mapping driver. In the short-term, we only need to model what’s necessary for our application’s authentication layer using OAuth2. For now, we’re creating a minimal set of objects to comply with the needs of our supporting libraries’ interfaces. We need a minimum of 6 entities and their corresponding repositories:

[Read More]