55 lines
2.4 KiB
PHP
55 lines
2.4 KiB
PHP
<?php namespace phpunit;
|
|
use \database\core\DatabaseDriver;
|
|
|
|
class Database_readableNumber extends \PHPUnit_Framework_TestCase{
|
|
|
|
|
|
private $formatted = '01 02 03 04 05';
|
|
|
|
/* [1] Gestion du formattage+affichage des numéros
|
|
=========================================================*/
|
|
public function testA(){
|
|
$this->assertEquals( DatabaseDriver::readableNumber('0102030405'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('01 02 03 04 05'), $this->formatted );
|
|
}
|
|
public function testB(){
|
|
$this->assertEquals( DatabaseDriver::readableNumber('+33102030405'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('+331 02 03 04 05'), $this->formatted );
|
|
}
|
|
|
|
public function testC(){
|
|
$this->assertEquals( DatabaseDriver::readableNumber('33102030405'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('331 02 03 04 05'), $this->formatted );
|
|
}
|
|
|
|
public function testCbis(){
|
|
$this->assertEquals( DatabaseDriver::readableNumber('033102030405'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('0331 02 03 04 05'), $this->formatted );
|
|
}
|
|
|
|
public function testBter(){
|
|
$this->assertEquals( DatabaseDriver::readableNumber('0033102030405'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('00331 02 03 04 05'), $this->formatted );
|
|
}
|
|
|
|
public function testFirstSpace(){
|
|
$this->assertEquals( DatabaseDriver::readableNumber('0 102030405'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('+33 102030405'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('33 102030405'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('033 102030405'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('0033 102030405'), $this->formatted );
|
|
}
|
|
|
|
public function testAllSpaces(){
|
|
$this->assertEquals( DatabaseDriver::readableNumber('0 1 02 03 04 05'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('+33 1 02 03 04 05'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('33 1 02 03 04 05'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('033 1 02 03 04 05'), $this->formatted );
|
|
$this->assertEquals( DatabaseDriver::readableNumber('0033 1 02 03 04 05'), $this->formatted );
|
|
}
|
|
|
|
|
|
}
|
|
|
|
?>
|