示例#1
0
 /**
  * @covers Xoops\Core\Text\Sanitizer::addPatternCallback
  * @covers Xoops\Core\Text\Sanitizer::filterForDisplay
  */
 public function testAddPatternCallback()
 {
     $this->object->addPatternCallback('~(\\d{4})-(\\d{2})-(\\d{2})~', function ($matches) {
         return $matches[2] . '/' . $matches[3] . '/' . $matches[1];
     });
     $text = '2015-12-14';
     $expected = '12/14/2015';
     $actual = $this->object->filterForDisplay($text);
     // Remove the following lines when you implement this test.
     $this->assertEquals($expected, $actual);
 }