Remove useless command addition

This commit is contained in:
Yassine Guedidi 2022-09-03 02:20:24 +02:00 committed by Jérémy Benoist
parent 39cd51a3f9
commit 6915a92047
10 changed files with 0 additions and 54 deletions

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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);

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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);