/** @test */ public function getAssociatedContacts() { $newCompanyResponse = $this->createCompany(); $companyId = $newCompanyResponse['companyId']; list($contactId) = $this->createAssociatedContact($companyId); $response = $this->companies->getAssociatedContacts($companyId); $this->assertEquals(200, $response->getStatusCode()); $this->assertCount(1, $response['contacts']); $this->assertEquals($contactId, $response['contacts'][0]['vid']); }
/** @test */ public function getAssociatedContactsWithCountAndOffset() { $newCompanyResponse = $this->createCompany(); $companyId = $newCompanyResponse['companyId']; list($contactId) = $this->createAssociatedContact($companyId); list($contactId2) = $this->createAssociatedContact($companyId); $response = $this->companies->getAssociatedContacts($companyId, ['count' => 1, 'vidOffset' => $contactId]); $this->assertEquals(200, $response->getStatusCode()); $this->assertCount(1, $response['contacts']); $offsetResponse = $this->companies->getAssociatedContacts($companyId, ['count' => 1, 'vidOffset' => $contactId2 + 1]); $this->assertEquals(200, $offsetResponse->getStatusCode()); $this->assertGreaterThanOrEqual($contactId2 + 1, $offsetResponse['vidOffset']); }