diff --git a/tests/Zendesk/API/UnitTests/Sell/ContactsTest.php b/tests/Zendesk/API/UnitTests/Sell/ContactsTest.php index c5539b6d..85996df0 100644 --- a/tests/Zendesk/API/UnitTests/Sell/ContactsTest.php +++ b/tests/Zendesk/API/UnitTests/Sell/ContactsTest.php @@ -40,10 +40,20 @@ public function testUpsert() ] ]; + $encodedQueryParams = []; + foreach ($queryParams as $key => $value) { + // Don't encode the email address + if ($key === 'email') { + $encodedQueryParams[$key] = $value; + continue; + } + $encodedQueryParams[$key] = rawurlencode($value); + } + $this->assertEndpointCalled(function () use ($queryParams, $postFields) { $this->client->sell->contacts()->upsert($queryParams, $postFields); }, '/contacts/upsert', 'POST', [ - 'queryParams' => $queryParams, + 'queryParams' => $encodedQueryParams, 'postFields' => ['data' => $postFields], 'apiBasePath' => '/v2' ]);