Skip to content

Commit

Permalink
Fixed tests on CustomerVerifyApiTest according to proposed changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cboita committed Jan 31, 2019
1 parent 1726027 commit fd98158
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Controller/CustomerVerifyApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public function it_allows_to_verify_customer()
$userRepository = $this->get('sylius.repository.shop_user');
$user = $userRepository->findOneByEmail('vinny@fandf.com');

$verifyEmail = sprintf('{"token": "%s"}', $user->getEmailVerificationToken());
$parameters = ['token' => $user->getEmailVerificationToken()];

$this->client->request('PUT', '/shop-api/WEB_GB/verify-account', [], [], ['CONTENT_TYPE' => 'application/json', 'ACCEPT' => 'application/json'], $verifyEmail);
$this->client->request('GET', '/shop-api/WEB_GB/verify-account', $parameters, [], ['ACCEPT' => 'application/json']);

$response = $this->client->getResponse();
$this->assertResponseCode($response, Response::HTTP_NO_CONTENT);
Expand Down Expand Up @@ -67,9 +67,9 @@ public function it_does_not_allow_to_verify_customer_in_non_existent_channel()
$userRepository = $this->get('sylius.repository.shop_user');
$user = $userRepository->findOneByEmail('vinny@fandf.com');

$verifyEmail = sprintf('{"token": "%s"}', $user->getEmailVerificationToken());
$parameters = ['token' => $user->getEmailVerificationToken()];

$this->client->request('PUT', '/shop-api/SPACE_KLINGON/verify-account', [], [], ['CONTENT_TYPE' => 'application/json', 'ACCEPT' => 'application/json'], $verifyEmail);
$this->client->request('GET', '/shop-api/SPACE_KLINGON/verify-account', $parameters, [], ['CONTENT_TYPE' => 'application/json', 'ACCEPT' => 'application/json']);

$response = $this->client->getResponse();
$this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND);
Expand Down

0 comments on commit fd98158

Please sign in to comment.