Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
83.33% |
5 / 6 |
CRAP | |
85.71% |
12 / 14 |
MedecinRepoTest | |
0.00% |
0 / 1 |
|
83.33% |
5 / 6 |
6.10 | |
85.71% |
12 / 14 |
__construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
testConstruct | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
testAddAndDelete | |
100.00% |
1 / 1 |
1 | |
100.00% |
4 / 4 |
|||
testSearch | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
testGetPatient | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
testGetById | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
<?php | |
/** | |
* Created by PhpStorm. | |
* User: seekdasky | |
* Date: 03/12/15 | |
* Time: 12:50 | |
*/ | |
class MedecinRepoTest extends PHPUnit_Framework_TestCase | |
{ | |
private $repo; | |
public function __construct(){ | |
$this->repo = new MedecinRepo(); | |
} | |
public function testConstruct(){ | |
$this->assertTrue(new MedecinRepo() instanceof MedecinRepo); | |
} | |
public function testAddAndDelete(){ | |
$id = $this->repo->add('M','Lucas','Mascaro'); | |
$this->assertNotNull($id); | |
$this->assertTrue($this->repo->delete($id)); | |
} | |
public function testSearch(){ | |
$this->assertEquals($this->repo->search('HUFF','Heather')[0]['Nom'],'HUFF'); | |
} | |
public function testGetPatient(){ | |
$this->assertEquals($this->repo->getPatients(9)[0]['Nom'],'PAUL'); | |
} | |
public function testGetById(){ | |
$this->assertEquals($this->repo->getById(1)['Nom'],'HUFF'); | |
} | |
} |