create(); parent::setUp(); $kernel = self::bootKernel(); $this->application = new Application($kernel); $this->application->add(new TimesheetStopAllCommand($service)); } public function testCommandName(): void { $command = $this->application->find('kimai:timesheet:stop-all'); self::assertInstanceOf(TimesheetStopAllCommand::class, $command); } public function testRun(): void { $command = $this->application->find('kimai:timesheet:stop-all'); $commandTester = new CommandTester($command); $commandTester->execute(['command' => $command->getName()]); $result = $commandTester->getDisplay(); self::assertStringContainsString('[OK] Stopped 0 timesheet records.', $result); self::assertEquals(0, $commandTester->getStatusCode()); } }