Move tests at root

This commit is contained in:
Romain Neutron
2012-04-14 12:07:49 +02:00
parent 855bb0d635
commit 855fd91081
260 changed files with 47666 additions and 0 deletions

50
tests/unicodeTest.php Normal file
View 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é'));
}
}