From 6915a92047ff0de6419610dbdb3559937ac59c97 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sat, 3 Sep 2022 02:20:24 +0200 Subject: [PATCH] Remove useless command addition --- .../CoreBundle/Command/CleanDuplicatesCommandTest.php | 5 ----- .../Wallabag/CoreBundle/Command/ExportCommandTest.php | 5 ----- .../Command/GenerateUrlHashesCommandTest.php | 5 ----- .../CoreBundle/Command/InstallCommandTest.php | 11 ----------- .../CoreBundle/Command/ListUserCommandTest.php | 5 ----- .../CoreBundle/Command/ReloadEntryCommandTest.php | 4 ---- .../CoreBundle/Command/ShowUserCommandTest.php | 5 ----- .../Wallabag/CoreBundle/Command/TagAllCommandTest.php | 4 ---- .../ImportBundle/Command/ImportCommandTest.php | 6 ------ .../ImportBundle/Command/RedisWorkerCommandTest.php | 4 ---- 10 files changed, 54 deletions(-) diff --git a/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php b/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php index 72d7dd513..29f8cd294 100644 --- a/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php @@ -6,7 +6,6 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\CoreBundle\Command\CleanDuplicatesCommand; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\UserBundle\Entity\User; @@ -15,7 +14,6 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase public function testRunCleanDuplicates() { $application = new Application($this->getClient()->getKernel()); - $application->add(new CleanDuplicatesCommand()); $command = $application->find('wallabag:clean-duplicates'); @@ -31,7 +29,6 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase public function testRunCleanDuplicatesCommandWithBadUsername() { $application = new Application($this->getClient()->getKernel()); - $application->add(new CleanDuplicatesCommand()); $command = $application->find('wallabag:clean-duplicates'); @@ -47,7 +44,6 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase public function testRunCleanDuplicatesCommandForUser() { $application = new Application($this->getClient()->getKernel()); - $application->add(new CleanDuplicatesCommand()); $command = $application->find('wallabag:clean-duplicates'); @@ -88,7 +84,6 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase $this->assertCount(2, $nbEntries); $application = new Application($this->getClient()->getKernel()); - $application->add(new CleanDuplicatesCommand()); $command = $application->find('wallabag:clean-duplicates'); diff --git a/tests/Wallabag/CoreBundle/Command/ExportCommandTest.php b/tests/Wallabag/CoreBundle/Command/ExportCommandTest.php index ac7c0792b..4e8d4c0d0 100644 --- a/tests/Wallabag/CoreBundle/Command/ExportCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/ExportCommandTest.php @@ -6,7 +6,6 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\CoreBundle\Command\ExportCommand; class ExportCommandTest extends WallabagCoreTestCase { @@ -16,7 +15,6 @@ class ExportCommandTest extends WallabagCoreTestCase $this->expectExceptionMessage('Not enough arguments (missing: "username")'); $application = new Application($this->getClient()->getKernel()); - $application->add(new ExportCommand()); $command = $application->find('wallabag:export'); @@ -29,7 +27,6 @@ class ExportCommandTest extends WallabagCoreTestCase public function testExportCommandWithBadUsername() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ExportCommand()); $command = $application->find('wallabag:export'); @@ -45,7 +42,6 @@ class ExportCommandTest extends WallabagCoreTestCase public function testExportCommand() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ExportCommand()); $command = $application->find('wallabag:export'); @@ -63,7 +59,6 @@ class ExportCommandTest extends WallabagCoreTestCase public function testExportCommandWithSpecialPath() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ExportCommand()); $command = $application->find('wallabag:export'); diff --git a/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php b/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php index f235619b6..d09515804 100644 --- a/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php @@ -6,7 +6,6 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\CoreBundle\Command\GenerateUrlHashesCommand; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\UserBundle\Entity\User; @@ -15,7 +14,6 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase public function testRunGenerateUrlHashesCommand() { $application = new Application($this->getClient()->getKernel()); - $application->add(new GenerateUrlHashesCommand()); $command = $application->find('wallabag:generate-hashed-urls'); @@ -31,7 +29,6 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase public function testRunGenerateUrlHashesCommandWithBadUsername() { $application = new Application($this->getClient()->getKernel()); - $application->add(new GenerateUrlHashesCommand()); $command = $application->find('wallabag:generate-hashed-urls'); @@ -47,7 +44,6 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase public function testRunGenerateUrlHashesCommandForUser() { $application = new Application($this->getClient()->getKernel()); - $application->add(new GenerateUrlHashesCommand()); $command = $application->find('wallabag:generate-hashed-urls'); @@ -77,7 +73,6 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase $em->flush(); $application = new Application($this->getClient()->getKernel()); - $application->add(new GenerateUrlHashesCommand()); $command = $application->find('wallabag:generate-hashed-urls'); diff --git a/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php b/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php index e81e50fec..a20a2fd3b 100644 --- a/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php @@ -5,7 +5,6 @@ namespace Tests\Wallabag\CoreBundle\Command; use DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticDriver; use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand; use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand; -use Doctrine\Bundle\MigrationsBundle\Command\MigrationsMigrateDoctrineCommand; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\SqlitePlatform; @@ -88,7 +87,6 @@ class InstallCommandTest extends WallabagCoreTestCase public function testRunInstallCommand() { $application = new Application($this->getClient()->getKernel()); - $application->add(new InstallCommand()); /** @var InstallCommand $command */ $command = $application->find('wallabag:install'); @@ -115,7 +113,6 @@ class InstallCommandTest extends WallabagCoreTestCase public function testRunInstallCommandWithReset() { $application = new Application($this->getClient()->getKernel()); - $application->add(new InstallCommand()); /** @var InstallCommand $command */ $command = $application->find('wallabag:install'); @@ -152,7 +149,6 @@ class InstallCommandTest extends WallabagCoreTestCase } $application = new Application($this->getClient()->getKernel()); - $application->add(new DropDatabaseDoctrineCommand()); // drop database first, so the install command won't ask to reset things $command = $application->find('doctrine:database:drop'); @@ -164,7 +160,6 @@ class InstallCommandTest extends WallabagCoreTestCase // start a new application to avoid lagging connexion to pgsql $client = static::createClient(); $application = new Application($client->getKernel()); - $application->add(new InstallCommand()); $command = $application->find('wallabag:install'); @@ -191,7 +186,6 @@ class InstallCommandTest extends WallabagCoreTestCase public function testRunInstallCommandChooseResetSchema() { $application = new Application($this->getClient()->getKernel()); - $application->add(new InstallCommand()); /** @var InstallCommand $command */ $command = $application->find('wallabag:install'); @@ -218,10 +212,6 @@ class InstallCommandTest extends WallabagCoreTestCase public function testRunInstallCommandChooseNothing() { $application = new Application($this->getClient()->getKernel()); - $application->add(new InstallCommand()); - $application->add(new DropDatabaseDoctrineCommand()); - $application->add(new CreateDatabaseDoctrineCommand()); - $application->add(new MigrationsMigrateDoctrineCommand()); // drop database first, so the install command won't ask to reset things $command = new DropDatabaseDoctrineCommand(); @@ -262,7 +252,6 @@ class InstallCommandTest extends WallabagCoreTestCase public function testRunInstallCommandNoInteraction() { $application = new Application($this->getClient()->getKernel()); - $application->add(new InstallCommand()); /** @var InstallCommand $command */ $command = $application->find('wallabag:install'); diff --git a/tests/Wallabag/CoreBundle/Command/ListUserCommandTest.php b/tests/Wallabag/CoreBundle/Command/ListUserCommandTest.php index 8a4f8a58f..69696bdc3 100644 --- a/tests/Wallabag/CoreBundle/Command/ListUserCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/ListUserCommandTest.php @@ -5,14 +5,12 @@ namespace Tests\Wallabag\CoreBundle\Command; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\CoreBundle\Command\ListUserCommand; class ListUserCommandTest extends WallabagCoreTestCase { public function testRunListUserCommand() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ListUserCommand()); $command = $application->find('wallabag:user:list'); @@ -27,7 +25,6 @@ class ListUserCommandTest extends WallabagCoreTestCase public function testRunListUserCommandWithLimit() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ListUserCommand()); $command = $application->find('wallabag:user:list'); @@ -43,7 +40,6 @@ class ListUserCommandTest extends WallabagCoreTestCase public function testRunListUserCommandWithSearch() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ListUserCommand()); $command = $application->find('wallabag:user:list'); @@ -59,7 +55,6 @@ class ListUserCommandTest extends WallabagCoreTestCase public function testRunListUserCommandWithSearchAndLimit() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ListUserCommand()); $command = $application->find('wallabag:user:list'); diff --git a/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php b/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php index 0bd4a5780..45cacf117 100644 --- a/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php @@ -5,7 +5,6 @@ namespace Tests\Wallabag\CoreBundle\Command; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\CoreBundle\Command\ReloadEntryCommand; use Wallabag\CoreBundle\Entity\Entry; class ReloadEntryCommandTest extends WallabagCoreTestCase @@ -51,7 +50,6 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase public function testRunReloadEntryCommand() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ReloadEntryCommand()); $command = $application->find('wallabag:entry:reload'); $tester = new CommandTester($command); @@ -79,7 +77,6 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase public function testRunReloadEntryWithUsernameCommand() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ReloadEntryCommand()); $command = $application->find('wallabag:entry:reload'); $tester = new CommandTester($command); @@ -104,7 +101,6 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase public function testRunReloadEntryWithoutEntryCommand() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ReloadEntryCommand()); $command = $application->find('wallabag:entry:reload'); $tester = new CommandTester($command); diff --git a/tests/Wallabag/CoreBundle/Command/ShowUserCommandTest.php b/tests/Wallabag/CoreBundle/Command/ShowUserCommandTest.php index 32cef11b1..51f8b2eb7 100644 --- a/tests/Wallabag/CoreBundle/Command/ShowUserCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/ShowUserCommandTest.php @@ -7,7 +7,6 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\CoreBundle\Command\ShowUserCommand; use Wallabag\UserBundle\Entity\User; class ShowUserCommandTest extends WallabagCoreTestCase @@ -18,7 +17,6 @@ class ShowUserCommandTest extends WallabagCoreTestCase $this->expectExceptionMessage('Not enough arguments'); $application = new Application($this->getClient()->getKernel()); - $application->add(new ShowUserCommand()); $command = $application->find('wallabag:user:show'); @@ -31,7 +29,6 @@ class ShowUserCommandTest extends WallabagCoreTestCase public function testRunShowUserCommandWithBadUsername() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ShowUserCommand()); $command = $application->find('wallabag:user:show'); @@ -47,7 +44,6 @@ class ShowUserCommandTest extends WallabagCoreTestCase public function testRunShowUserCommandForUser() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ShowUserCommand()); $command = $application->find('wallabag:user:show'); @@ -80,7 +76,6 @@ class ShowUserCommandTest extends WallabagCoreTestCase $em->flush(); $application = new Application($this->getClient()->getKernel()); - $application->add(new ShowUserCommand()); $command = $application->find('wallabag:user:show'); diff --git a/tests/Wallabag/CoreBundle/Command/TagAllCommandTest.php b/tests/Wallabag/CoreBundle/Command/TagAllCommandTest.php index 04526311c..4fea25aae 100644 --- a/tests/Wallabag/CoreBundle/Command/TagAllCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/TagAllCommandTest.php @@ -6,7 +6,6 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\CoreBundle\Command\TagAllCommand; class TagAllCommandTest extends WallabagCoreTestCase { @@ -16,7 +15,6 @@ class TagAllCommandTest extends WallabagCoreTestCase $this->expectExceptionMessage('Not enough arguments (missing: "username")'); $application = new Application($this->getClient()->getKernel()); - $application->add(new TagAllCommand()); $command = $application->find('wallabag:tag:all'); @@ -29,7 +27,6 @@ class TagAllCommandTest extends WallabagCoreTestCase public function testRunTagAllCommandWithBadUsername() { $application = new Application($this->getClient()->getKernel()); - $application->add(new TagAllCommand()); $command = $application->find('wallabag:tag:all'); @@ -45,7 +42,6 @@ class TagAllCommandTest extends WallabagCoreTestCase public function testRunTagAllCommand() { $application = new Application($this->getClient()->getKernel()); - $application->add(new TagAllCommand()); $command = $application->find('wallabag:tag:all'); diff --git a/tests/Wallabag/ImportBundle/Command/ImportCommandTest.php b/tests/Wallabag/ImportBundle/Command/ImportCommandTest.php index 750e748db..36ee76dbf 100644 --- a/tests/Wallabag/ImportBundle/Command/ImportCommandTest.php +++ b/tests/Wallabag/ImportBundle/Command/ImportCommandTest.php @@ -8,7 +8,6 @@ use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\ImportBundle\Command\ImportCommand; class ImportCommandTest extends WallabagCoreTestCase { @@ -18,7 +17,6 @@ class ImportCommandTest extends WallabagCoreTestCase $this->expectExceptionMessage('Not enough arguments'); $application = new Application($this->getClient()->getKernel()); - $application->add(new ImportCommand()); $command = $application->find('wallabag:import'); @@ -34,7 +32,6 @@ class ImportCommandTest extends WallabagCoreTestCase $this->expectExceptionMessage('not found'); $application = new Application($this->getClient()->getKernel()); - $application->add(new ImportCommand()); $command = $application->find('wallabag:import'); @@ -51,7 +48,6 @@ class ImportCommandTest extends WallabagCoreTestCase $this->expectException(NoResultException::class); $application = new Application($this->getClient()->getKernel()); - $application->add(new ImportCommand()); $command = $application->find('wallabag:import'); @@ -66,7 +62,6 @@ class ImportCommandTest extends WallabagCoreTestCase public function testRunImportCommand() { $application = new Application($this->getClient()->getKernel()); - $application->add(new ImportCommand()); $command = $application->find('wallabag:import'); @@ -87,7 +82,6 @@ class ImportCommandTest extends WallabagCoreTestCase $this->logInAs('admin'); $application = new Application($this->getClient()->getKernel()); - $application->add(new ImportCommand()); $command = $application->find('wallabag:import'); diff --git a/tests/Wallabag/ImportBundle/Command/RedisWorkerCommandTest.php b/tests/Wallabag/ImportBundle/Command/RedisWorkerCommandTest.php index f27439af3..a8c79dc0e 100644 --- a/tests/Wallabag/ImportBundle/Command/RedisWorkerCommandTest.php +++ b/tests/Wallabag/ImportBundle/Command/RedisWorkerCommandTest.php @@ -9,7 +9,6 @@ use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\ImportBundle\Command\RedisWorkerCommand; class RedisWorkerCommandTest extends WallabagCoreTestCase { @@ -19,7 +18,6 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase $this->expectExceptionMessage('Not enough arguments (missing: "serviceName")'); $application = new Application($this->getClient()->getKernel()); - $application->add(new RedisWorkerCommand()); $command = $application->find('wallabag:import:redis-worker'); @@ -35,7 +33,6 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase $this->expectExceptionMessage('No queue or consumer found for service name'); $application = new Application($this->getClient()->getKernel()); - $application->add(new RedisWorkerCommand()); $command = $application->find('wallabag:import:redis-worker'); @@ -49,7 +46,6 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase public function testRunRedisWorkerCommand() { $application = new Application($this->getClient()->getKernel()); - $application->add(new RedisWorkerCommand()); $factory = new RedisMockFactory(); $redisMock = $factory->getAdapter(Client::class, true);