From fb93ed7fc36c72d082b3c7278320455f8a3ff7bf Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 17 Jul 2017 15:00:54 +0300 Subject: [PATCH] MiddlewareDomainEventBus not require publisher EventBus --- src/DomainEvent/Bus/MiddlewareDomainEventBus.php | 9 +-------- tests/DomainEvent/Bus/MiddlewareDomainEventBusTest.php | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/DomainEvent/Bus/MiddlewareDomainEventBus.php b/src/DomainEvent/Bus/MiddlewareDomainEventBus.php index 9054d9f..170c11a 100644 --- a/src/DomainEvent/Bus/MiddlewareDomainEventBus.php +++ b/src/DomainEvent/Bus/MiddlewareDomainEventBus.php @@ -17,11 +17,6 @@ class MiddlewareDomainEventBus implements EventBus { - /** - * @var EventBus - */ - private $bus_publisher; - /** * @var MiddlewareChain */ @@ -29,11 +24,9 @@ class MiddlewareDomainEventBus implements EventBus /** * @param MiddlewareChain $chain - * @param EventBus $bus_publisher */ - public function __construct(MiddlewareChain $chain, EventBus $bus_publisher) + public function __construct(MiddlewareChain $chain) { - $this->bus_publisher = $bus_publisher; $this->chain = $chain; } diff --git a/tests/DomainEvent/Bus/MiddlewareDomainEventBusTest.php b/tests/DomainEvent/Bus/MiddlewareDomainEventBusTest.php index 2fe6125..2133434 100644 --- a/tests/DomainEvent/Bus/MiddlewareDomainEventBusTest.php +++ b/tests/DomainEvent/Bus/MiddlewareDomainEventBusTest.php @@ -13,16 +13,10 @@ use GpsLab\Component\Middleware\Chain\MiddlewareChain; use GpsLab\Component\Middleware\DomainEvent\Bus\MiddlewareDomainEventBus; use GpsLab\Domain\Event\Aggregator\AggregateEvents; -use GpsLab\Domain\Event\Bus\EventBus; use GpsLab\Domain\Event\Event; class MiddlewareDomainEventBusTest extends \PHPUnit_Framework_TestCase { - /** - * @var \PHPUnit_Framework_MockObject_MockObject|EventBus - */ - private $event_bus; - /** * @var \PHPUnit_Framework_MockObject_MockObject|MiddlewareChain */ @@ -35,9 +29,8 @@ class MiddlewareDomainEventBusTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->event_bus = $this->getMock(EventBus::class); $this->chain = $this->getMock(MiddlewareChain::class); - $this->bus = new MiddlewareDomainEventBus($this->chain, $this->event_bus); + $this->bus = new MiddlewareDomainEventBus($this->chain); } public function testPublish()