--- /dev/null
+<?php
+
+class ContractsControllerTest extends AlloServeurTest {
+
+ /** @var ContractsController */
+ private $contractsController;
+
+ protected function setUp(){
+ $this->contractsController = new ContractsController();
+ $this->contractsController->setGetParameters(new GetParameters(array()));
+ }
+
+ public function testGetNb(){
+ $this->assertEquals(1,$this->contractsController->nbAction());
+ }
+
+ public function testGetList(){
+ $list = $this->contractsController->listAction();
+ $this->assertEquals('PA/VILLEBEAU_30032/2014',$list[0]['number']);
+ }
+
+ public function testlistByCustomerActionApIdNotFound(){
+ $this->contractsController->setGetParametersByArray(array('ap_id'=>'unknown'));
+ $this->setExpectedException("Exception","ap_id (unknown) inconnu sur ce serveur.");
+ $this->contractsController->listByCustomerAction();
+ }
+
+ public function testlistByCustomerAction(){
+ $this->contractsController->setGetParametersByArray(array('ap_id'=>'VILLEBEAU_30032'));
+ $info = $this->contractsController->listByCustomerAction();
+ $this->assertEquals("PA/VILLEBEAU_30032/2014",$info[0]['number']);
+ }
+
+
+}
\ No newline at end of file