visitsHelper = $this->createMock(VisitsStatsHelperInterface::class); $this->commandTester = CliTestUtils::testerForCommand(new GetOrphanVisitsCommand($this->visitsHelper)); } #[Test] public function outputIsProperlyGenerated(): void { $visit = Visit::forBasePath(new Visitor('bar', 'foo', '', ''))->locate( VisitLocation::fromGeolocation(new Location('', 'Spain', '', 'Madrid', 0, 0, '')), ); $this->visitsHelper->expects($this->once())->method('orphanVisits')->withAnyParameters()->willReturn( new Paginator(new ArrayAdapter([$visit])), ); $this->commandTester->execute([]); $output = $this->commandTester->getDisplay(); self::assertEquals( <<getDate()->toAtomString()} | bar | Spain | Madrid | base_url | +---------+---------------------------+------------+---------+--------+----------+ OUTPUT, $output, ); } }