--- /dev/null
+<?php
+
+class AlloControllerTest extends AlloServeurTest {
+
+ /** @var AlloController */
+ private $alloController;
+
+ protected function setUp() {
+ parent::setUp();
+ $this->alloController = new AlloController();
+ $sugarWrapper = $this->getMockBuilder("SugarWrapper")->disableOriginalConstructor()->getMock();
+ $entry_list = array('foo'=>array('name'=>'bar'));
+ $sugarWrapper->expects($this->any())->method("simpleRetrieve")->willReturn($entry_list);
+ /** @var SugarWrapper $sugarWrapper*/
+ $this->alloController->setSugarWrapper($sugarWrapper);
+
+ }
+
+ public function testVersion(){
+ $info = $this->alloController->versionAction();
+ $this->assertEquals("Allo",$info['name']);
+ }
+
+ public function testGetSynchronizeCommand(){
+ $this->assertContains("all",$this->alloController->getSynchronizeCommand());
+ }
+
+ public function testSynchronize(){
+ $this->alloController->setGetParametersByArray(array('object'=>"product"));
+ $this->alloController->synchronizeAction();
+ }
+
+ public function testSynchonizeBadCommand(){
+ $this->alloController->setGetParametersByArray(array('object'=>"foo"));
+ $this->setExpectedException("Exception","Commande de synchronisation iconnue");
+ $this->alloController->synchronizeAction();
+ }
+
+}
\ No newline at end of file