private function buildConnection() { $connection = $this->prophesize(Connection::class); $connection->getEventManager()->willReturn($this->prophesize(EventManager::class)->reveal()); return $connection->reveal(); }