Enclosed Value

' => '

Enclosed Value

', '

' => '

', '' => '', '/bodu>/body>' => '/bodu>/body>' ); foreach($invalid as $input => $expected) { $value->setContent($input); $this->assertEquals($expected, $value->getContent(), 'Invalid HTML can be saved'); } } public function testInvalidHTMLTagNames() { $value = new SS_HTMLValue(); $invalid = array ( '

', '
', '""\'\'\'"""\'""<<<>/' ); foreach($invalid as $input) { $value->setContent($input); $this->assertEquals ( 'test-link', $value->getElementsByTagName('a')->item(0)->getAttribute('href'), 'Link data can be extraced from malformed HTML' ); } } public function testMixedNewlines() { $value = new SS_HTMLValue(); $eol = "\n"; $platformEOL = PHP_EOL; // native EOL for platform. Windows is \r\n (CR-LF). UNIX is LF $value->setContent("

paragraph

{$platformEOL}
  • 1
  • \r\n
"); $this->assertEquals( "

paragraph

{$eol}
  • 1
  • {$eol}
", $value->getContent(), 'Newlines get converted' ); } }