MigrationCommand example

$loader->expects(static::once())->method('collect')->willReturn(
            new MigrationCollection(
                new MigrationSource(''),
                new MigrationRuntime($connectionnew NullLogger()),
                $connection
            )
        );

        $cache = $this->getMockBuilder(TagAwareAdapter::class)->disableOriginalConstructor()->getMock();
        $cache->expects(static::never())->method('clear');

        $command = new MigrationCommand($loader$cache$this->getContainer()->getParameter('kernel.shopware_version'));

        $command->run(new ArrayInput(['--all' => true, 'identifier' => [self::INTEGRATION_IDENTIFIER()]])new BufferedOutput());

        static::assertSame(0, $this->getMigrationCount(true));
    }

    public function testCommandMigrateCacheClearBehaviourWithOneMigration(): void
    {
        static::assertSame(0, $this->getMigrationCount(true));

        $cache = $this->getMockBuilder(TagAwareAdapter::class)->disableOriginalConstructor()->getMock();
        
Home | Imprint | This part of the site doesn't use cookies.