projet-php/test/StaticRepoTest.php

30 lines
920 B
PHP

<?php
/**
* Created by PhpStorm.
* User: seekdasky
* Date: 09/12/15
* Time: 12:44
*/
class StaticRepoTest extends PHPUnit_Framework_TestCase
{
public function testGetConnexion(){
$this->assertTrue(StaticRepo::getConnexion() instanceof PDO);
}
public function testTestConnexion(){
$this->assertTrue(StaticRepo::testConnexion());
}
public function testDelNumericOneDimension(){
$array = [0=>'kjbk','kughk'=>'kjbk',1=>'aze','azert'=>'aza'];
$this->assertEquals(StaticRepo::delNumeric($array,true),['kughk'=>'kjbk','azert'=>'aza']);
}
public function testDelNumericTwoDimension(){
$array = [0=>[0=>'kjbk','kughk'=>'kjbk',1=>'aze','azert'=>'aze'],1=>[0=>'kjbk','kughk'=>'kjbk',1=>'aze','azert'=>'aza']];
$this->assertEquals(StaticRepo::delNumeric($array),[0=>['kughk'=>'kjbk','azert'=>'aze'],1=>['kughk'=>'kjbk','azert'=>'aza']]);
}
}