Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Api/General/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ private function getContact(string $idOrEmail): ResponseInterface
private function updateContact(string $contactIdOrEmail, UpdateContact $contact): ResponseInterface
{
return $this->handleResponse(
$this->httpPut(
$this->httpPatch(
path: $this->getBasePath() . '/' . urlencode($contactIdOrEmail),
body: ['contact' => $contact->toArray()]
)
Expand Down
8 changes: 4 additions & 4 deletions tests/Api/General/ContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function setUp(): void
parent::setUp();

$this->contact = $this->getMockBuilder(Contact::class)
->onlyMethods(['httpGet', 'httpPost', 'httpPut', 'httpPatch', 'httpDelete'])
->onlyMethods(['httpGet', 'httpPost', 'httpPatch', 'httpDelete'])
->setConstructorArgs([$this->getConfigMock(), self::FAKE_ACCOUNT_ID])
->getMock();
}
Expand Down Expand Up @@ -236,7 +236,7 @@ public function testUpdateContactById(): void
$contactDTO = new UpdateContact('test@example.com', ['last_name' => 'Smith'], [3], [1, 2], true);

$this->contact->expects($this->once())
->method('httpPut')
->method('httpPatch')
->with(
AbstractApi::DEFAULT_HOST . '/api/accounts/' . self::FAKE_ACCOUNT_ID . '/contacts/' . $contactId,
[],
Expand Down Expand Up @@ -266,7 +266,7 @@ public function testUpdateContactByEmail(): void
$contactDTO = new UpdateContact('test@example.com', ['last_name' => 'Smith'], [3], [1, 2], true);

$this->contact->expects($this->once())
->method('httpPut')
->method('httpPatch')
->with(
AbstractApi::DEFAULT_HOST . '/api/accounts/' . self::FAKE_ACCOUNT_ID . '/contacts/' . urlencode($contactEmail),
[],
Expand All @@ -289,7 +289,7 @@ public function testUpdateContactExcludesNullUnsubscribed(): void
$contactDTO = new UpdateContact($contactEmail, ['last_name' => 'Smith'], [3], [1, 2]);

$this->contact->expects($this->once())
->method('httpPut')
->method('httpPatch')
->with(
AbstractApi::DEFAULT_HOST . '/api/accounts/' . self::FAKE_ACCOUNT_ID . '/contacts/' . urlencode($contactEmail),
[],
Expand Down
Loading