php fallback if function "phrasea_utf8_convert_to" is not available

This commit is contained in:
jygaulier
2013-05-07 14:33:54 +02:00
parent 61fdc3dc2b
commit 3be31a7ac8
2 changed files with 1585 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,25 @@ class unicodeTest extends PhraseanetPHPUnitAbstract
$this->object = new unicode(); $this->object = new unicode();
} }
/**
* @covers \unicode::testUtf8_convert_to
*/
public function testUtf8_convert_to()
{
$this->assertEquals('éléphant à rôtir', $this->object->utf8_convert_to('ÉLÉPHANT à rôtir', unicode::CONVERT_TO_LC));
$this->assertEquals('ELEPHANT a rotir', $this->object->utf8_convert_to('ÉLÉPHANT à rôtir', unicode::CONVERT_TO_ND));
$this->assertEquals('elephant a rotir', $this->object->utf8_convert_to('ÉLÉPHANT à rôtir', unicode::CONVERT_TO_LCND));
}
/**
* @covers \unicode::testUtf8_convert_to
* @expectedException Exception_InvalidArgument
*/
public function testUtf8_convert_to_ex()
{
$this->assertEquals('éléphant à rôtir', $this->object->utf8_convert_to('ÉLÉPHANT à rôtir', 'bad-method'));
}
/** /**
* @covers \unicode::remove_diacritics * @covers \unicode::remove_diacritics
*/ */
@@ -25,6 +44,7 @@ class unicodeTest extends PhraseanetPHPUnitAbstract
} }
/** /**
*
* @covers \unicode::remove_nonazAZ09 * @covers \unicode::remove_nonazAZ09
*/ */
public function testRemove_nonazAZ09() public function testRemove_nonazAZ09()