mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 12:03:14 +00:00
Move tests at root
This commit is contained in:
50
tests/unicodeTest.php
Normal file
50
tests/unicodeTest.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/PhraseanetPHPUnitAbstract.class.inc';
|
||||
|
||||
/**
|
||||
* Test class for unicode.
|
||||
* Generated by PHPUnit on 2011-05-27 at 16:32:47.
|
||||
*/
|
||||
class unicodeTest extends PhraseanetPHPUnitAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
* @var unicode
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->object = new unicode();
|
||||
}
|
||||
|
||||
public function testRemove_diacritics()
|
||||
{
|
||||
$this->assertEquals('Elephant', $this->object->remove_diacritics('Eléphant'));
|
||||
$this->assertEquals('&e"\'(-e_ca)=$*u:;,?./§%µ£°0987654321œ3~#{[|^`@]}e³²÷׿', $this->object->remove_diacritics('&é"\'(-è_çà)=$*ù:;,?./§%µ£°0987654321Œ3~#{[|^`@]}ê³²÷׿'));
|
||||
$this->assertEquals('PeTARDS', $this->object->remove_diacritics('PéTARDS'));
|
||||
}
|
||||
|
||||
public function testRemove_nonazAZ09()
|
||||
{
|
||||
$this->assertEquals('Elephant', $this->object->remove_nonazAZ09('Eléphant'));
|
||||
$this->assertEquals('e-e_cau09876543213e', $this->object->remove_nonazAZ09('&é"\'(-è_çà)=$*ù:;,?./§%µ£°0987654321Œ3~#{[|^`@]}ê³²÷׿', true, true));
|
||||
$this->assertEquals('eecau09876543213e', $this->object->remove_nonazAZ09('&é"\'(-è_çà)=$*ù:;,?./§%µ£°0987654321Œ3~#{[|^`@]}ê³²÷׿', false, false));
|
||||
$this->assertEquals('ee_cau09876543213e', $this->object->remove_nonazAZ09('&é"\'(-è_çà)=$*ù:;,?./§%µ£°0987654321Œ3~#{[|^`@]}ê³²÷׿', true, false));
|
||||
$this->assertEquals('e-ecau09876543213e', $this->object->remove_nonazAZ09('&é"\'(-è_çà)=$*ù:;,?./§%µ£°0987654321Œ3~#{[|^`@]}ê³²÷׿', false, true));
|
||||
$this->assertEquals('PeTARDS', $this->object->remove_nonazAZ09('PéTARDS'));
|
||||
}
|
||||
|
||||
|
||||
public function testRemove_first_digits()
|
||||
{
|
||||
$this->assertEquals('', $this->object->remove_first_digits('123456789'));
|
||||
$this->assertEquals('abcdeé', $this->object->remove_first_digits('12345abcdeé'));
|
||||
$this->assertEquals('abcdeé0987', $this->object->remove_first_digits('abcdeé0987'));
|
||||
$this->assertEquals('a2b5cdeé', $this->object->remove_first_digits('4a2b5cdeé'));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user