Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Domain-Driven Design in PHP

You're reading from   Domain-Driven Design in PHP A Highly Practical Guide

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher
ISBN-13 9781787284944
Length 394 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Keyvan Akbary Keyvan Akbary
Author Profile Icon Keyvan Akbary
Keyvan Akbary
Carlos Buenosvinos Carlos Buenosvinos
Author Profile Icon Carlos Buenosvinos
Carlos Buenosvinos
Christian Soronellas Christian Soronellas
Author Profile Icon Christian Soronellas
Christian Soronellas
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Getting Started with Domain-Driven Design FREE CHAPTER 2. Architectural Styles 3. Value Objects 4. Entities 5. Services 6. Domain-Events 7. Modules 8. Aggregates 9. Factories 10. Repositories 11. Application 12. Integrating Bounded Contexts 13. Hexagonal Architecture with PHP 14. Bibliography
15. The End

Testing Infrastructure

If you want to achieve 100% coverage for your whole application you will also have to test your infrastructure. Before doing that, you need to know that those unit tests will be more coupled to your implementation than the business ones. That means that the probability to be broken with implementation details changes is higher. So it is a trade-off you will have to consider.

So, if you want to continue, we need to do some modifications. We need to decouple even more. Let's see the code in Listing 13:

class IdeaController extends Zend_Controller_Action
{
public function rateAction()
{
$ideaId = $this->request->getParam('id');
$rating = $this->request->getParam('rating');

$useCase = new RateIdeaUseCase(
new RedisIdeaRepository(
new Predis\Client()
)
);

$response = $useCase->execute...
lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Domain-Driven Design in PHP
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime
Modal Close icon
Modal Close icon