Contao\CoreBundle\Test\DataContainer\PaletteManipulatorTest::testApplyToDcaPalette PHP Method

testApplyToDcaPalette() public method

Tests applying the changes to a DCA palette.
    public function testApplyToDcaPalette()
    {
        $pm = PaletteManipulator::create()->addLegend('foobar_legend', '', PaletteManipulator::POSITION_APPEND)->addField(['foo', 'bar'], 'foobar_legend', PaletteManipulator::POSITION_APPEND);
        $GLOBALS['TL_DCA']['tl_test']['palettes']['default'] = '{name_legend},name';
        $pm->applyToPalette('default', 'tl_test');
        $this->assertEquals('{name_legend},name;{foobar_legend},foo,bar', $GLOBALS['TL_DCA']['tl_test']['palettes']['default']);
    }