NxTIC/test/phpunit/tests/Database_readableNumber.php

55 lines
2.4 KiB
PHP
Raw Normal View History

2016-04-20 09:59:21 +00:00
<?php namespace phpunit;
use \database\core\DatabaseDriver;
2016-04-20 09:59:21 +00:00
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 );
2016-04-20 09:59:21 +00:00
}
public function testB(){
$this->assertEquals( DatabaseDriver::readableNumber('+33102030405'), $this->formatted );
$this->assertEquals( DatabaseDriver::readableNumber('+331 02 03 04 05'), $this->formatted );
2016-04-20 09:59:21 +00:00
}
public function testC(){
$this->assertEquals( DatabaseDriver::readableNumber('33102030405'), $this->formatted );
$this->assertEquals( DatabaseDriver::readableNumber('331 02 03 04 05'), $this->formatted );
2016-04-20 09:59:21 +00:00
}
public function testCbis(){
$this->assertEquals( DatabaseDriver::readableNumber('033102030405'), $this->formatted );
$this->assertEquals( DatabaseDriver::readableNumber('0331 02 03 04 05'), $this->formatted );
2016-04-20 09:59:21 +00:00
}
public function testBter(){
$this->assertEquals( DatabaseDriver::readableNumber('0033102030405'), $this->formatted );
$this->assertEquals( DatabaseDriver::readableNumber('00331 02 03 04 05'), $this->formatted );
2016-04-20 09:59:21 +00:00
}
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 );
2016-04-20 09:59:21 +00:00
}
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 );
2016-04-20 09:59:21 +00:00
}
}
?>