Sindbad~EG File Manager
<?php
namespace Html2Text;
class HtmlCharsTest extends \PHPUnit_Framework_TestCase
{
public function testLaquoAndRaquo()
{
$html = 'This library name is «Html2Text»';
$expected = 'This library name is «Html2Text»';
$html2text = new Html2Text($html);
$this->assertEquals($expected, $html2text->getText());
}
public function provideSymbols()
{
// A variety of symbols that either used to have special handling
// or still does.
return array(
// Non-breaking space, not a regular one.
array(' ', ' '),
array('>', '>'),
array('<', '<'),
array('©', '©'),
array('©', '©'),
array('™', '™'),
// The TM symbol in Windows-1252, invalid in HTML...
array('™', '™'),
// Correct TM symbol numeric code
array('™', '™'),
array('®', '®'),
array('®', '®'),
array('—', '—'),
// The m-dash in Windows-1252, invalid in HTML...
array('—', '—'),
// Correct m-dash numeric code
array('—', '—'),
array('•', '•'),
array('£', '£'),
array('£', '£'),
array('€', '€'),
array('&', '&'),
);
}
/**
* @dataProvider provideSymbols
*/
public function testSymbol($entity, $symbol)
{
$html = "$entity signs should be UTF-8 symbols";
$expected = "$symbol signs should be UTF-8 symbols";
$html2text = new Html2Text($html);
$this->assertEquals($expected, $html2text->getText());
}
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists