diff --git a/src/Resources/Deals.php b/src/Resources/Deals.php index b6882a49..ac148406 100644 --- a/src/Resources/Deals.php +++ b/src/Resources/Deals.php @@ -2,39 +2,42 @@ namespace SevenShores\Hubspot\Resources; -use SevenShores\Hubspot\Exceptions\HubspotException; - +/** + * @see https://developers.hubspot.com/docs/methods/deals/deals_overview + */ class Deals extends Resource { /** - * @param array $deal array of deal properties + * Create a deal. + * + * @see https://developers.hubspot.com/docs/methods/deals/create_deal * - * @throws HubSpotException + * @param array $deal array of deal properties * - * @return mixed + * @return \SevenShores\Hubspot\Http\Response */ public function create(array $deal) { $endpoint = 'https://api.hubapi.com/deals/v1/deal'; - $options['json'] = $deal; - - return $this->client->request('post', $endpoint, $options); + return $this->client->request('post', $endpoint, ['json' => $deal]); } /** + * Update a Deal. + * + * @see https://developers.hubspot.com/docs/methods/deals/update_deal + * * @param int $id the deal id * @param array $deal the deal properties to update * - * @return mixed + * @return \SevenShores\Hubspot\Http\Response */ public function update($id, array $deal) { $endpoint = "https://api.hubapi.com/deals/v1/deal/{$id}"; - $options['json'] = $deal; - - return $this->client->request('put', $endpoint, $options); + return $this->client->request('put', $endpoint, ['json' => $deal]); } /** @@ -50,12 +53,14 @@ public function updateBatch(array $deals) { $endpoint = 'https://api.hubapi.com/deals/v1/batch-async/update'; - $options['json'] = $deals; - - return $this->client->request('post', $endpoint, $options); + return $this->client->request('post', $endpoint, ['json' => $deals]); } /** + * Get all deals. + * + * @see https://developers.hubspot.com/docs/methods/deals/get-all-deals + * * @throws \SevenShores\Hubspot\Exceptions\BadRequest * * @return \Psr\Http\Message\ResponseInterface|\SevenShores\Hubspot\Http\Response @@ -64,53 +69,76 @@ public function getAll(array $params = []) { $endpoint = 'https://api.hubapi.com/deals/v1/deal/paged'; - $queryString = build_query_string($params); - - return $this->client->request('get', $endpoint, [], $queryString); + return $this->client->request( + 'get', + $endpoint, + [], + build_query_string($params) + ); } /** - * @param int $id + * Get Recently Modified Deals. * - * @return mixed + * @see https://developers.hubspot.com/docs/methods/deals/get_deals_modified + * + * @param array $params Optional parameters ['limit', 'offset'] + * + * @return \SevenShores\Hubspot\Http\Response */ - public function delete($id) + public function getRecentlyModified(array $params = []) { - $endpoint = "https://api.hubapi.com/deals/v1/deal/{$id}"; + $endpoint = 'https://api.hubapi.com/deals/v1/deal/recent/modified'; - return $this->client->request('delete', $endpoint); + return $this->client->request( + 'get', + $endpoint, + [], + build_query_string($params) + ); } /** + * Get Recently Created Deals. + * + * @see https://developers.hubspot.com/docs/methods/deals/get_deals_created + * * @param array $params Optional parameters ['limit', 'offset'] * - * @return mixed + * @return \SevenShores\Hubspot\Http\Response */ - public function getRecentlyModified(array $params = []) + public function getRecentlyCreated(array $params = []) { - $endpoint = 'https://api.hubapi.com/deals/v1/deal/recent/modified'; + $endpoint = 'https://api.hubapi.com/deals/v1/deal/recent/created'; $queryString = build_query_string($params); return $this->client->request('get', $endpoint, [], $queryString); } /** - * @param array $params Optional parameters ['limit', 'offset'] + * Delete a Deal. + * + * @see https://developers.hubspot.com/docs/methods/deals/delete_deal * - * @return mixed + * @param int $id + * + * @return \SevenShores\Hubspot\Http\Response */ - public function getRecentlyCreated(array $params = []) + public function delete($id) { - $endpoint = 'https://api.hubapi.com/deals/v1/deal/recent/created'; - $queryString = build_query_string($params); + $endpoint = "https://api.hubapi.com/deals/v1/deal/{$id}"; - return $this->client->request('get', $endpoint, [], $queryString); + return $this->client->request('delete', $endpoint); } /** + * Get a Deal. + * + * @see https://developers.hubspot.com/docs/methods/deals/get_deal + * * @param int $id * - * @return mixed + * @return \SevenShores\Hubspot\Http\Response */ public function getById($id) { @@ -120,95 +148,147 @@ public function getById($id) } /** + * Associate a deal with a company. + * + * @see https://developers.hubspot.com/docs/methods/deals/associate_deal + * * @param int $dealId * @param int|int[] $companyIds * - * @return mixed + * @deprecated + * + * @return \SevenShores\Hubspot\Http\Response */ public function associateWithCompany($dealId, $companyIds) { $endpoint = "https://api.hubapi.com/deals/v1/deal/{$dealId}/associations/COMPANY"; - $queryString = build_query_string(['id' => (array) $companyIds]); - - return $this->client->request('put', $endpoint, [], $queryString); + return $this->client->request( + 'put', + $endpoint, + [], + build_query_string(['id' => (array) $companyIds]) + ); } /** + * Removes a deal's association with a company. + * + * @see https://developers.hubspot.com/docs/methods/deals/delete_association + * * @param int $dealId * @param int|int[] $companyIds * - * @return mixed + * @deprecated + * + * @return \SevenShores\Hubspot\Http\Response */ public function disassociateFromCompany($dealId, $companyIds) { $endpoint = "https://api.hubapi.com/deals/v1/deal/{$dealId}/associations/COMPANY"; - $queryString = build_query_string(['id' => (array) $companyIds]); - - return $this->client->request('delete', $endpoint, [], $queryString); + return $this->client->request( + 'delete', + $endpoint, + [], + build_query_string(['id' => (array) $companyIds]) + ); } /** + * Associate a deal with a contact. + * + * @see https://developers.hubspot.com/docs/methods/deals/associate_deal + * * @param int $dealId * @param int|int[] $contactIds * - * @return mixed + * @deprecated + * + * @return \SevenShores\Hubspot\Http\Response */ public function associateWithContact($dealId, $contactIds) { $endpoint = "https://api.hubapi.com/deals/v1/deal/{$dealId}/associations/CONTACT"; - $queryString = build_query_string(['id' => (array) $contactIds]); - - return $this->client->request('put', $endpoint, [], $queryString); + return $this->client->request( + 'put', + $endpoint, + [], + build_query_string(['id' => (array) $contactIds]) + ); } /** + * Get Associated Deals. + * + * @see https://developers.hubspot.com/docs/methods/deals/get-associated-deals + * * @param int $contactId * @param array $params Optional parameters ['limit', 'offset'] * - * @return mixed + * @deprecated + * + * @return \SevenShores\Hubspot\Http\Response */ public function associatedWithContact($contactId, $params = []) { $endpoint = "https://api.hubapi.com/deals/v1/deal/associated/contact/{$contactId}/paged"; - $queryString = build_query_string($params); - - return $this->client->request('get', $endpoint, [], $queryString); + return $this->client->request( + 'get', + $endpoint, + [], + build_query_string($params) + ); } /** + * Removes a deal's association with a contact. + * + * @see https://developers.hubspot.com/docs/methods/deals/delete_association + * * @param int $dealId * @param int|int[] $contactIds * - * @return mixed + * @deprecated + * + * @return \SevenShores\Hubspot\Http\Response */ public function disassociateFromContact($dealId, $contactIds) { $endpoint = "https://api.hubapi.com/deals/v1/deal/{$dealId}/associations/CONTACT"; - $queryString = build_query_string(['id' => (array) $contactIds]); - - return $this->client->request('delete', $endpoint, [], $queryString); + return $this->client->request( + 'delete', + $endpoint, + [], + build_query_string(['id' => (array) $contactIds]) + ); } /** + * Get Associated Deals. + * + * @see https://developers.hubspot.com/docs/methods/deals/get-associated-deals + * * @param string $objectType * @param int $objectId * @param array $params * - * @return \Psr\Http\Message\ResponseInterface|\SevenShores\Hubspot\Http\Response + * @deprecated * - * @see https://developers.hubspot.com/docs/methods/deals/get-associated-deals + * @return \Psr\Http\Message\ResponseInterface|\SevenShores\Hubspot\Http\Response */ public function getAssociatedDeals($objectType, $objectId, $params = []) { $endpoint = "https://api.hubapi.com/deals/v1/deal/associated/{$objectType}/{$objectId}/paged"; - $queryString = build_query_string($params); - - return $this->client->request('get', $endpoint, [], $queryString); + return $this->client->request( + 'get', + $endpoint, + [], + build_query_string($params) + ); } } diff --git a/src/Resources/ObjectProperties.php b/src/Resources/ObjectProperties.php index bb170611..59d047bc 100644 --- a/src/Resources/ObjectProperties.php +++ b/src/Resources/ObjectProperties.php @@ -3,24 +3,22 @@ namespace SevenShores\Hubspot\Resources; /** - * * @see https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview */ class ObjectProperties extends Resource { /** - * - * @var string + * @var string */ protected $objectType; - + public function __construct($client, $objectType) { parent::__construct($client); - + $this->objectType = $objectType; } - + /** * Get an Object Property. * @@ -34,7 +32,7 @@ public function get($name) return $this->client->request('get', $endpoint); } - + /** * Get all object properties. * @@ -48,7 +46,7 @@ public function all() return $this->client->request('get', $endpoint); } - + /** * Create a new object property. * @@ -62,9 +60,9 @@ public function create(array $property) return $this->client->request('post', $endpoint, ['json' => $property]); } - + /** - * Update an object property + * Update an object property. * * Update a specified contact property. * @@ -82,11 +80,10 @@ public function update($name, array $property) return $this->client->request('patch', $endpoint, ['json' => $property]); } - + /** * Delete an object property. * - * * @see https://developers.hubspot.com/docs/methods/crm-properties/delete-property * * @param string $name @@ -99,7 +96,7 @@ public function delete($name) return $this->client->request('delete', $endpoint); } - + /** * Get all object property groups. * @@ -120,13 +117,14 @@ public function getGroups($includeProperties = false) return $this->client->request('get', $endpoint, [], $queryString); } - + /** * Get an object property group. * * @see https://developers.hubspot.com/docs/methods/crm-properties/get-property-groups * - * @param bool $includeProperties + * @param bool $includeProperties + * @param mixed $name * * @return \SevenShores\Hubspot\Http\Response */ diff --git a/tests/Integration/Resources/DealsTest.php b/tests/Integration/Resources/DealsTest.php index c1b8ae0c..785f700d 100644 --- a/tests/Integration/Resources/DealsTest.php +++ b/tests/Integration/Resources/DealsTest.php @@ -6,6 +6,7 @@ use SevenShores\Hubspot\Resources\Companies; use SevenShores\Hubspot\Resources\Contacts; use SevenShores\Hubspot\Resources\Deals; +use SevenShores\Hubspot\Tests\Integration\Abstraction\EntityTestCase; /** * Class DealsTest. @@ -15,46 +16,31 @@ * @internal * @coversNothing */ -class DealsTest extends \PHPUnit_Framework_TestCase +class DealsTest extends EntityTestCase { /** - * @var Deals + * @var Deals::class */ - private $deals; - - public function setUp() - { - parent::setUp(); - $this->deals = new Deals(new Client(['key' => getenv('HUBSPOT_TEST_API_KEY')])); - sleep(1); - } + protected $resourceClass = Deals::class; /** - * @test + * @var Contacts */ - public function create() - { - $response = $this->createDeal(); + protected $resourceContacts; - $this->assertEquals(200, $response->getStatusCode()); - $this->assertSame('Cool Deal', $response['properties']['dealname']['value']); - $this->assertSame('60000', $response['properties']['amount']['value']); - } + /** + * @var Companies + */ + protected $resourceCompanies; /** * @test */ - public function find() + public function create() { - $response = $this->createDeal(); - $id = $response['dealId']; - - //Should not be able to find a deal after it was deleted - $response = $this->deals->getById($id); - - $this->assertEquals(200, $response->getStatusCode()); - $this->assertSame('Cool Deal', $response['properties']['dealname']['value']); - $this->assertSame('60000', $response['properties']['amount']['value']); + $this->assertEquals(200, $this->entity->getStatusCode()); + $this->assertSame('Cool Deal', $this->entity->properties->dealname->value); + $this->assertSame('60000', $this->entity->properties->amount->value); } /** @@ -62,11 +48,7 @@ public function find() */ public function update() { - $response = $this->createDeal(); - - $id = $response->dealId; - - $response = $this->deals->update($id, [ + $response = $this->resource->update($this->entity->dealId, [ 'properties' => [ [ 'name' => 'amount', @@ -76,7 +58,7 @@ public function update() ]); $this->assertEquals(200, $response->getStatusCode()); - $this->assertSame('70000', $response['properties']['amount']['value']); + $this->assertSame('70000', $response->properties->amount->value); } /** @@ -84,20 +66,18 @@ public function update() */ public function updateBatch() { - $this->markTestSkipped(); // TODO: fix test - $deal1 = $this->createDeal(); - $deal2 = $this->createDeal(); + $deal = $this->createEntity(); - $response = $this->deals->updateBatch([ + $response = $this->resource->updateBatch([ [ - 'objectId' => $deal1->dealId, + 'objectId' => $this->entity->dealId, 'properties' => [ ['name' => 'dealname', 'value' => 'Even cooler Deal'], ['name' => 'amount', 'value' => '59999'], ], ], [ - 'objectId' => $deal2->dealId, + 'objectId' => $deal->dealId, 'properties' => [ ['name' => 'dealname', 'value' => 'Still ok Deal'], ], @@ -106,160 +86,161 @@ public function updateBatch() $this->assertEquals(202, $response->getStatusCode()); - $response = $this->deals->getById($deal1->dealId); - $this->assertSame('Even cooler Deal', $response['properties']['dealname']['value']); - $this->assertSame('59999', $response['properties']['amount']['value']); - - $response = $this->deals->getById($deal2->dealId); - $this->assertSame('Still ok Deal', $response['properties']['dealname']['value']); + $this->resource->delete($deal->dealId); } /** * @test */ - public function delete() + public function all() { - $this->markTestSkipped(); // TODO: fix test - $response = $this->createDeal(); - $id = $response['dealId']; - - $response = $this->deals->delete($id); - $this->assertEquals(204, $response->getStatusCode()); + $response = $this->resource->getAll([ + 'offset' => 1, + 'limit' => 1, + ]); - //Should not be able to find a deal after it was deleted - $response = $this->deals->getById($id); - $this->assertEquals(404, $response->getStatusCode()); + $this->assertEquals(200, $response->getStatusCode()); + $this->assertEquals(1, count($response->deals)); } /** * @test */ - public function recentlyCreated() + public function getRecentlyModified() { - //Create 4 deals - for ($i = 1; $i <= 4; ++$i) { - $this->createDeal(); - } + $this->resource->update($this->entity->dealId, [ + 'properties' => [ + [ + 'name' => 'amount', + 'value' => '70000', + ], + ], + ]); - $response = $this->deals->getRecentlyCreated([ + $response = $this->resource->getRecentlyModified([ 'offset' => 1, - 'count' => 3, + 'count' => 1, ]); $this->assertEquals(200, $response->getStatusCode()); - $this->assertSame(3, count($response['results'])); + $this->assertEquals(1, count($response->results)); } /** - * @getAll + * @test */ - public function getAll() + public function getRecentlyCreated() { - $response = $this->deals->getAll([ + $response = $this->resource->getRecentlyCreated([ 'offset' => 1, - 'count' => 2, + 'count' => 1, ]); $this->assertEquals(200, $response->getStatusCode()); - $this->assertSame(2, count($response['results'])); + $this->assertEquals(1, count($response->results)); } /** * @test */ - public function recentlyModified() + public function delete() { - $response = $this->deals->getRecentlyModified([ - 'offset' => 1, - 'count' => 2, - ]); + $response = $this->deleteEntity(); + $this->assertEquals(204, $response->getStatusCode()); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertSame(2, count($response['results'])); + $this->entity = null; } /** - * @group now + * @test */ - public function associateWithCompany() + public function getById() { - $dealId = $this->createDeal()->dealId; + $response = $this->resource->getById($this->entity->dealId); + + $this->assertEquals(200, $response->getStatusCode()); + $this->assertSame('Cool Deal', $response->properties->dealname->value); + $this->assertSame('60000', $response->properties->amount->value); + } + /** + * @test + */ + public function associateAndDisassociateWithCompany() + { $firstCompanyId = $this->createCompany(); $secondCompanyId = $this->createCompany(); $thirdCompanyId = $this->createCompany(); - $response = $this->deals->associateWithCompany($dealId, [ + $associateResponse = $this->resource->associateWithCompany($this->entity->dealId, [ $firstCompanyId, $secondCompanyId, $thirdCompanyId, ]); - $this->assertSame(204, $response->getStatusCode()); + $this->assertEquals(204, $associateResponse->getStatusCode()); //Check what was associated - $response = $this->deals->getById($dealId); + $byIdResponse = $this->resource->getById($this->entity->dealId); - $associatedCompanies = $response->associations->associatedCompanyIds; + $associatedCompanies = $byIdResponse->associations->associatedCompanyIds; $expectedAssociatedCompanies = [$firstCompanyId, $secondCompanyId, $thirdCompanyId]; - //sorting as order is not predicatable sort($associatedCompanies); sort($expectedAssociatedCompanies); $this->assertEquals($expectedAssociatedCompanies, $associatedCompanies); //Now disassociate - $response = $this->deals->disassociateFromCompany($dealId, [ + $response = $this->resource->disassociateFromCompany($this->entity->dealId, [ $firstCompanyId, + $secondCompanyId, $thirdCompanyId, ]); $this->assertSame(204, $response->getStatusCode()); - //Ensure that only one associated company left - $response = $this->deals->getById($dealId); - $this->assertSame([$secondCompanyId], $response->associations->associatedCompanyIds); + foreach ($expectedAssociatedCompanies as $id) { + $this->deleteCompany($id); + } } /** * @test */ - public function associateWithContact() + public function associateAndDisassociateWithContact() { - $dealId = $this->createDeal()->dealId; - $firstContactId = $this->createContact(); $secondContactId = $this->createContact(); $thirdContactId = $this->createContact(); - $response = $this->deals->associateWithContact($dealId, [ + $associateResponse = $this->resource->associateWithContact($this->entity->dealId, [ $firstContactId, $secondContactId, $thirdContactId, ]); - $this->assertSame(204, $response->getStatusCode()); + $this->assertSame(204, $associateResponse->getStatusCode()); //Check what was associated - $response = $this->deals->getById($dealId); + $byIdResponse = $this->resource->getById($this->entity->dealId); - $associatedContacts = $response->associations->associatedVids; + $associatedContacts = $byIdResponse->associations->associatedVids; $expectedAssociatedContacts = [$firstContactId, $secondContactId, $thirdContactId]; - //sorting as order is not predicatable sort($associatedContacts); sort($expectedAssociatedContacts); $this->assertEquals($expectedAssociatedContacts, $associatedContacts); //Now disassociate - $response = $this->deals->disassociateFromContact($dealId, [ + $response = $this->resource->disassociateFromContact($this->entity->dealId, [ $firstContactId, + $secondContactId, $thirdContactId, ]); $this->assertSame(204, $response->getStatusCode()); - //Ensure that only one associated contact left - $response = $this->deals->getById($dealId); - $this->assertSame([$secondContactId], $response->associations->associatedVids); + foreach ($expectedAssociatedContacts as $id) { + $this->deleteContact($id); + } } /** @@ -269,18 +250,22 @@ public function getAssociatedDealsByCompany() { $companyId = $this->createCompany(); - $firstDeal = $this->createDeal()->dealId; - $secondDeal = $this->createDeal()->dealId; + $deal = $this->createEntity()->dealId; - $this->deals->associateWithCompany($firstDeal, [ + $this->resource->associateWithCompany($this->entity->dealId, [ $companyId, ]); - $this->deals->associateWithCompany($secondDeal, [ + + $this->resource->associateWithCompany($deal, [ $companyId, ]); - $response = $this->deals->getAssociatedDeals('company', $companyId); + $response = $this->resource->getAssociatedDeals('company', $companyId); $this->assertCount(2, $response->deals); + + $this->resource->delete($deal); + + $this->deleteCompany($companyId); } /** @@ -290,30 +275,50 @@ public function getAssociatedDealsByContact() { $contactId = $this->createContact(); - $firstDeal = $this->createDeal()->dealId; - $secondDeal = $this->createDeal()->dealId; - $thirdDeal = $this->createDeal()->dealId; + $deal = $this->createEntity()->dealId; - $this->deals->associateWithContact($firstDeal, [ - $contactId, - ]); - $this->deals->associateWithContact($secondDeal, [ + $this->resource->associateWithContact($this->entity->dealId, [ $contactId, ]); - $this->deals->associateWithContact($thirdDeal, [ + + $this->resource->associateWithContact($deal, [ $contactId, ]); - $response = $this->deals->getAssociatedDeals('contact', $contactId); - $this->assertCount(3, $response->deals); + $response = $this->resource->getAssociatedDeals('contact', $contactId); + $this->assertCount(2, $response->deals); + + $this->resource->delete($deal); + $this->deleteContact($contactId); } - // Lots of tests need an existing object to modify. - private function createDeal() + protected function createCompany() { - sleep(1); + return $this->getCompanies() + ->create(['name' => 'name', 'value' => 'dl_test_company'.uniqid()]) + ->companyId; + } - return $this->deals->create([ + protected function createContact() + { + return $this->getContacts()->create([ + ['property' => 'email', 'value' => 'dl_test_contact'.uniqid().'@hubspot.com'], + ])->vid; + } + + protected function deleteCompany($id) + { + return $this->getCompanies()->delete($id); + } + + protected function deleteContact($id) + { + return $this->getContacts()->delete($id); + } + + protected function createEntity() + { + return $this->resource->create([ 'properties' => [ [ 'value' => 'Cool Deal', @@ -327,24 +332,26 @@ private function createDeal() ]); } - /** - * @return int - */ - private function createCompany() + protected function deleteEntity() { - $companies = new Companies(new Client(['key' => getenv('HUBSPOT_TEST_API_KEY')])); - - return $companies->create(['name' => 'name', 'value' => 'dl_test_company'.uniqid()])->companyId; + return $this->resource->delete($this->entity->dealId); } - private function createContact() + protected function getContacts() { - $contacts = new Contacts(new Client(['key' => getenv('HUBSPOT_TEST_API_KEY')])); + if (empty($this->resourceContacts)) { + $this->resourceContacts = new Contacts(new Client(['key' => getenv('HUBSPOT_TEST_API_KEY')])); + } - $response = $contacts->create([ - ['property' => 'email', 'value' => 'dl_test_contact'.uniqid().'@hubspot.com'], - ]); + return $this->resourceContacts; + } + + protected function getCompanies() + { + if (empty($this->resourceCompanies)) { + $this->resourceCompanies = new Companies(new Client(['key' => getenv('HUBSPOT_TEST_API_KEY')])); + } - return $response->vid; + return $this->resourceCompanies; } } diff --git a/tests/Integration/Resources/ObjectPropertiesTest.php b/tests/Integration/Resources/ObjectPropertiesTest.php index e9f32033..db501877 100644 --- a/tests/Integration/Resources/ObjectPropertiesTest.php +++ b/tests/Integration/Resources/ObjectPropertiesTest.php @@ -2,8 +2,8 @@ namespace SevenShores\Hubspot\Tests\Integration\Resources; -use SevenShores\Hubspot\Tests\Integration\Abstraction\PropertiesTestCase; use SevenShores\Hubspot\Factory; +use SevenShores\Hubspot\Tests\Integration\Abstraction\PropertiesTestCase; /** * @internal @@ -15,7 +15,7 @@ class ObjectPropertiesTest extends PropertiesTestCase * @var string */ protected $groupName = 'productinformation'; - + public function setUp() { $this->resource = Factory::create(getenv('HUBSPOT_TEST_API_KEY'))->objectProperties('products'); diff --git a/tests/Integration/Resources/ObjectPropertyGroupsTest.php b/tests/Integration/Resources/ObjectPropertyGroupsTest.php index 8a7f975b..58ab54f9 100644 --- a/tests/Integration/Resources/ObjectPropertyGroupsTest.php +++ b/tests/Integration/Resources/ObjectPropertyGroupsTest.php @@ -2,8 +2,8 @@ namespace SevenShores\Hubspot\Tests\Integration\Resources; -use SevenShores\Hubspot\Tests\Integration\Abstraction\PropertyGroupsTestCase; use SevenShores\Hubspot\Factory; +use SevenShores\Hubspot\Tests\Integration\Abstraction\PropertyGroupsTestCase; /** * @internal @@ -15,14 +15,14 @@ class ObjectPropertyGroupsTest extends PropertyGroupsTestCase * @var string */ protected $allGroupsMethod = 'getGroups'; - + public function setUp() { $this->resource = Factory::create(getenv('HUBSPOT_TEST_API_KEY'))->objectProperties('products'); sleep(1); $this->entity = $this->createEntity(); } - + /** @test */ public function get() {