Skip to content

Commit

Permalink
MiddlewareDomainEventBus not require publisher EventBus
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Jul 17, 2017
1 parent 8848f30 commit fb93ed7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
9 changes: 1 addition & 8 deletions src/DomainEvent/Bus/MiddlewareDomainEventBus.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,16 @@

class MiddlewareDomainEventBus implements EventBus
{
/**
* @var EventBus
*/
private $bus_publisher;

/**
* @var MiddlewareChain
*/
private $chain;

/**
* @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;
}

Expand Down
9 changes: 1 addition & 8 deletions tests/DomainEvent/Bus/MiddlewareDomainEventBusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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()
Expand Down

0 comments on commit fb93ed7

Please sign in to comment.