Exemple #1
0
 /**
  *
  */
 public function testCustomers()
 {
     $ot = $this->getOnTimeObjectOk();
     $result = $ot->customers();
     $this->assertTrue(is_array($result['data']));
     //
     $ot = $this->getOnTimeObjectOk();
     $filterT1 = new Customers();
     $resultT1 = $ot->customers($filterT1);
     $this->assertTrue(is_array($resultT1['data']));
     //
     $ot = $this->getOnTimeObjectOk();
     $filterT2 = new Customers();
     $filterT2->setId(1);
     $resultT2 = $ot->customers($filterT2);
     $this->assertTrue(is_array($resultT2['data']));
     //
     $ot = $this->getOnTimeObjectOk();
     $filterT3 = new Customers();
     $filterT3->setId(9999);
     $resultT3 = $ot->customers($filterT3);
     $this->assertNull($resultT3['data']);
     //
     $ot = $this->getOnTimeObjectOk();
     $filterT4 = new Customers();
     $filterT4->setSearchString('h');
     $resultT4 = $ot->customers($filterT4);
     $this->assertEquals(2, count($resultT4['data']));
     //
     $ot = $this->getOnTimeObjectOk();
     $filterT5 = new Customers();
     $filterT5->setSearchString('fail');
     $resultT5 = $ot->customers($filterT5);
     $this->assertEquals(0, count($resultT5['data']));
 }