IncrementStorageRegistry example

$this->registry->getStorage('foo');
    }

    public function testMigrateToSqlStorage(): void
    {
        $arrayStorage = new IncrementArrayStorage([
            Uuid::randomHex() => 10,
            Uuid::randomHex() => 4,
        ]);
        $sqlStorage = $this->getContainer()->get(IncrementSqlStorage::class);

        $registry = new IncrementStorageRegistry(
            new \ArrayObject(
                [
                    'SQL' => $sqlStorage,
                    'Array' => $arrayStorage,
                ],
            ),
            'SQL'
        );

        static::assertEmpty($sqlStorage->list());

        
private IncrementArrayStorage $arrayStorage;

    private CommandTester $tester;

    protected function setUp(): void
    {
        $this->sqlStorage = $this->getContainer()->get(IncrementSqlStorage::class);
        $this->arrayStorage = new IncrementArrayStorage([]);

        $command = new MigrateIncrementStorageCommand(
            new IncrementStorageRegistry(new \ArrayObject(
                [
                    'SQL' => $this->sqlStorage,
                    'Array' => $this->arrayStorage,
                ]
            ), 'SQL')
        );

        $this->tester = new CommandTester($command);
    }

    public function testMigrateWithConfirmation(): void
    {
Home | Imprint | This part of the site doesn't use cookies.