Skip to content

Commit

Permalink
Merge pull request #299 from neos/bugfix/refactor-unittest
Browse files Browse the repository at this point in the history
BUGFIX: Refactor JobQueueEventPublisherTest::publishQueuesAJobForEach…
  • Loading branch information
bwaidelich authored Mar 12, 2022
2 parents 730c041 + cb4aa2b commit 0743f57
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Tests/Unit/EventPublisher/JobQueueEventPublisherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,10 @@ public function publishQueuesAJobForEachListener(): void
->withMapping(EventToListenerMapping::create(\get_class($this->mockEvent2), 'SomeListenerClassName1', []));
$jobQueueEventPublisher = $this->buildPublisher('event-store-id', $mappings);

$this->mockJobManager->expects($this->at(0))->method('queue')->willReturnCallback(static function(string $_, CatchUpEventListenerJob $job) {
self::assertSame('SomeListenerClassName1', $job->getListenerClassName());
});

$this->mockJobManager->expects($this->at(1))->method('queue')->willReturnCallback(static function(string $_, CatchUpEventListenerJob $job) {
self::assertSame('SomeListenerClassName2', $job->getListenerClassName());
});

$this->mockJobManager->expects(self::exactly(2))->method('queue')->withConsecutive(
['neos-eventsourcing', self::callback(static function(CatchUpEventListenerJob $job) { return $job->getListenerClassName() === 'SomeListenerClassName1'; })],
['neos-eventsourcing', self::callback(static function(CatchUpEventListenerJob $job) { return $job->getListenerClassName() === 'SomeListenerClassName2'; })],
);
$jobQueueEventPublisher->publish($this->mockEvents);
}

Expand Down

0 comments on commit 0743f57

Please sign in to comment.