code cleanup (#3338)

This commit is contained in:
Kevin Papst
2022-05-31 18:08:41 +02:00
committed by GitHub
parent 88bf534573
commit 3f827b3104
5 changed files with 45 additions and 52 deletions

View File

@@ -10,7 +10,6 @@
namespace App\Tests\Command;
use App\Command\ResetDevelopmentCommand;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
@@ -24,15 +23,19 @@ class ResetDevelopmentCommandTest extends KernelTestCase
{
$kernel = self::bootKernel();
$application = new Application($kernel);
$application->add(new ResetDevelopmentCommand('test', $this->createMock(EntityManagerInterface::class)));
$application->add(new ResetDevelopmentCommand());
self::assertTrue($application->has('kimai:reset-dev'));
$command = $application->find('kimai:reset-dev');
self::assertInstanceOf(ResetDevelopmentCommand::class, $command);
}
public function testCommandNameIsNotEnabledInProd()
{
$command = new ResetDevelopmentCommand('prod', $this->createMock(EntityManagerInterface::class));
self::assertFalse($command->isEnabled());
$kernel = self::bootKernel(['environment' => 'prod']);
$application = new Application($kernel);
$application->add(new ResetDevelopmentCommand());
self::assertFalse($application->has('kimai:reset-dev'));
}
}