code cleanup (#3338)
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user