public function testReplaceMatch() { $this->assertSame('hallo … world.', $this->_paging->replaceMatch('hallo foo-bar world.', '…')); $this->assertSame('hallo $1 \\1 world.', $this->_paging->replaceMatch('hallo foo-bar world.', '$1 \\1')); $this->assertSame('Hello … world.', $this->_paging->replaceMatch('Hello zoo world.', '…')); $this->assertSame('Hello … world.', $this->_paging->replaceMatch('Hello sub.zoo.com world.', '…')); }
public function transform($text, CM_Frontend_Render $render) { $text = (string) $text; $badwordList = new CM_Paging_ContentList_Badwords(); $text = $badwordList->replaceMatch($text, '…'); return $text; }