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

testAddFieldToEmptyPalette() public method

Tests adding a field to an empty palette.
    public function testAddFieldToEmptyPalette()
    {
        $pm = PaletteManipulator::create()->addLegend('name_legend', '', PaletteManipulator::POSITION_PREPEND)->addField('name', 'name_legend', PaletteManipulator::POSITION_APPEND);
        $this->assertEquals('{name_legend},name', $pm->applyToString(''));
        $pm = PaletteManipulator::create()->addField('name', 'name_legend', PaletteManipulator::POSITION_APPEND);
        $this->assertEquals('name', $pm->applyToString(''));
        $pm = PaletteManipulator::create()->addField('name', 'name_legend', PaletteManipulator::POSITION_APPEND, 'name_legend');
        $this->assertEquals('{name_legend},name', $pm->applyToString(''));
    }