button = new CustomButton('serendipity[body]'); } /** * @test * @dataProvider getCustomData */ public function render($name, $openTag, $closeTag) { $this->button->setName('ins_custom_' . $name); $this->button->setValue($name); $this->button->setOpen($openTag); $this->button->setClose($closeTag); $expected = ' ' . PHP_EOL; $this->assertEquals($expected, $this->button->render()); } /** * @test * @dataProvider getCustomData */ public function renderInLegacyMode($name, $openTag, $closeTag) { $this->button->setIsLegacyMode(true); $this->button->setName('ins_custom_' . $name); $this->button->setValue($name); $this->button->setOpen($openTag); $this->button->setClose($closeTag); $expected = ' ' . PHP_EOL; $this->assertEquals($expected, $this->button->render()); } /** * Data provider for custom buttons * * @return array */ public function getCustomData() { return array( array('code', '', ''), array('pre', '
', '
'), array('bash', '[geshi lang=bash]', '[/geshi]'), array('perl', '[geshi lang=perl]', '[/geshi]'), array('sql', '[geshi lang=sql]', '[/geshi]'), array('li', '
  • ', '
  • '), ); } }