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

testAppendFieldToPalette() public method

Tests appending a field.
    public function testAppendFieldToPalette()
    {
        $pm = PaletteManipulator::create()->addField('bar', 'config_legend', PaletteManipulator::POSITION_APPEND, 'config_legend');
        $this->assertEquals('{config_legend},foo,bar', $pm->applyToString('{config_legend},foo'));
        $this->assertEquals('{config_legend},foo,bar;{foo_legend},baz', $pm->applyToString('{config_legend},foo;{foo_legend},baz'));
        $this->assertEquals('{foo_legend},baz;{config_legend},bar', $pm->applyToString('{foo_legend},baz'));
    }