예제 #1
0
 /**
  * @test
  * @dataProvider emptyTagsDataProvider
  * @param bool $stripOn TRUE if stripping should be activated.
  * @param string $tagList Comma seperated list of tags that should be stripped.
  * @param bool $treatNonBreakingSpaceAsEmpty If TRUE   will be considered empty.
  * @param string $content The HTML code that should be modified.
  * @param string $expectedResult The expected HTML code result.
  */
 public function stripEmptyTags($stripOn, $tagList, $treatNonBreakingSpaceAsEmpty, $content, $expectedResult)
 {
     $tsConfig = array('keepNonMatchedTags' => 1, 'stripEmptyTags' => $stripOn, 'stripEmptyTags.' => array('tags' => $tagList, 'treatNonBreakingSpaceAsEmpty' => $treatNonBreakingSpaceAsEmpty));
     $config = $this->subject->HTMLparserConfig($tsConfig);
     $result = $this->subject->HTMLcleaner($content, $config[0], $config[1], $config[2], $config[3]);
     $this->assertEquals($expectedResult, $result);
 }
예제 #2
0
 /**
  * Calls HTMLparserConfig() and passes the generated config to the HTMLcleaner() method on the current subject.
  *
  * @param array $tsConfig The TypoScript that should be used to generate the HTML parser config.
  * @param string $content The content that should be parsed by the HTMLcleaner.
  * @return string The parsed content.
  */
 protected function parseConfigAndCleanHtml(array $tsConfig, $content)
 {
     $config = $this->subject->HTMLparserConfig($tsConfig);
     return $this->subject->HTMLcleaner($content, $config[0], $config[1], $config[2], $config[3]);
 }