fixDoctrineBug($kernel->getContainer()); // temporarily set global configuration as globalPaidMembership = true $configuration = $this->getConfigurationRepository()->getInstanceConfigurationOrCreate(); $newConfig = $configuration->getConfiguration(); $newConfig['global']['globalPaidMembership'] = true; $configuration->setConfiguration($newConfig); $this->getConfigurationRepository()->save($configuration, true); $application = new Application($kernel); $command = $application->find(EndPlatformMembershipCommand::CMD); $commandTester = new CommandTester($command); $commandTester->execute([]); $commandTester->assertCommandIsSuccessful(); self::assertEmailCount(1); self::assertNotificationCount(1); $output = $commandTester->getDisplay(); self::assertStringContainsString(\sprintf('%d update', 1), $output); // already deleted $commandTester->execute([]); $commandTester->assertCommandIsSuccessful(); self::assertEmailCount(1); // not +1 self::assertNotificationCount(1); $output = $commandTester->getDisplay(); self::assertStringContainsString(\sprintf('%d update', 0), $output); } }