ConfigSet example


#[Package('system-settings')] class ConfigSetCommandTest extends TestCase
{
    private ConfigSet $configSetCommand;

    private SystemConfigService&MockObject $systemConfigService;

    protected function setUp(): void
    {
        $this->systemConfigService = $this->createMock(SystemConfigService::class);
        $this->configSetCommand = new ConfigSet($this->systemConfigService);
    }

    public static function configValueProvider(): \Generator
    {
        /* value, expected_value, decode */
        yield 'String false' => ['false', 'false', false];
        yield 'Decode string false' => ['false', false, true];
        yield 'String int' => ['4', '4', false];
        yield 'Decode String int' => ['5', 5, true];
        yield 'String float' => ['2.2', '2.2', false];
        yield 'Decode String float' => ['3.3', 3.3, true];
        

        $container->addTab($tab);

        $tab->addElement($this->createBottomTabPanel());
    }

    /** * Helper function to merge default theme colors with color schemes. */
    public function createConfigSets(ArrayCollection $collection)
    {
        $set = new ConfigSet();
        $set->setName('__color_scheme_turquoise__')->setDescription(
            '__color_scheme_turquoise_description__'
        )->setValues(
            array_merge(
                $this->themeColorDefaults,
                [
                    'brand-primary' => '#1db3b8',
                    'brand-primary-light' => 'lighten(@brand-primary, 5%)',
                ]
            )
        );
        
'attributes' => ['lessCompatible' => false]]
            )
        );

        $tab->addElement($fieldSet);

        $container->addTab($tab);
    }

    public function createConfigSets(ArrayCollection $collection)
    {
        $set = new ConfigSet();
        $set->setName('__bare_min_appearance__')
            ->setDescription('__bare_min_appearance_description__')
            ->setValues(['color' => '#fff']);
        $collection->add($set);

        $set = new ConfigSet();
        $set->setName('__bare_max_appearance__')
            ->setDescription('__bare_max_appearance_description__')
            ->setValues(['color' => '#fff']);

        $collection->add($set);
    }
Home | Imprint | This part of the site doesn't use cookies.