fixDoctrineBug($kernel->getContainer()); $application = new Application($kernel); $command = $application->find(EndMembershipCommand::CMD); $commandTester = new CommandTester($command); $commandTester->execute([]); $commandTester->assertCommandIsSuccessful(); self::assertEmailCount(1); self::assertNotificationCount(1); $output = $commandTester->getDisplay(); self::assertStringContainsString(sprintf('%d deletion', 1), $output); // already deleted $commandTester->execute([]); $commandTester->assertCommandIsSuccessful(); self::assertEmailCount(1); // not +1 self::assertNotificationCount(1); $output = $commandTester->getDisplay(); self::assertStringContainsString(sprintf('%d deletion', 0), $output); } }