コード例 #1
0
ファイル: RubricTest.php プロジェクト: consultnn/api-client
 public function testAll()
 {
     $rubrics = $this->rubric->all();
     $this->assertTrue(is_array($rubrics), 'Rubrics is array');
     $this->assertNotEmpty($rubrics, 'Rubrics not empty');
     foreach ($rubrics as $rubric) {
         $this->assertTrue($rubric instanceof \consultnn\api\mappers\Rubric, 'Each value must be instance of Rubric');
     }
 }
コード例 #2
0
ファイル: CompanyTest.php プロジェクト: consultnn/api-client
 public function testByRubrics()
 {
     $rubrics = array_map(function ($rubric) {
         return $rubric->id;
     }, $this->rubric->all());
     $companies = $this->company->byRubricIds($rubrics, ['not_filial' => 1]);
     $this->assertTrue(is_array($companies));
     foreach ($companies as $company) {
         $this->assertTrue($company instanceof \consultnn\api\mappers\Company);
         $this->assertNotEmpty(array_intersect($rubrics, $company->rubrics));
         if (isset($company->branch->headOfficeId)) {
             $this->assertEquals($company->id, $company->branch->headOfficeId);
         }
     }
 }