Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
#486: Add customer account validation in Quote operations
Browse files Browse the repository at this point in the history
  • Loading branch information
naydav committed Jun 20, 2019
1 parent a8ea439 commit d983e25
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,27 +162,6 @@ public function testChangePasswordIfNewPasswordIsEmpty()
$this->graphQlMutation($query, [], '', $headerMap);
}

/**
* @magentoApiDataFixture Magento/GraphQl/Customer/_files/enable_customer_account_confirmation.php
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @expectedException \Exception
* @expectedExceptionMessage This account isn't confirmed. Verify and try again.
*/
public function testChangePasswordIfAccountIsNotConfirmed()
{
$customerEmail = 'customer@example.com';
$currentPassword = 'password';
$newPassword = 'anotherPassword1';

/* get header map before setting the customer unconfirmed */
$headerMap = $this->getCustomerAuthHeaders($customerEmail, $currentPassword);

$this->setCustomerConfirmation(1);
$query = $this->getQuery($currentPassword, $newPassword);

$this->graphQlMutation($query, [], '', $headerMap);
}

/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @expectedException \Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,6 @@ public function testGetCustomerWithAddresses()
$this->assertCustomerAddressesFields($customer, $response);
}

/**
* @magentoApiDataFixture Magento/Customer/_files/inactive_customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_address.php
* @magentoApiDataFixture Magento/Customer/_files/customer_confirmation_config_enable.php
* @expectedException Exception
* @expectedExceptionMessage The account sign-in was incorrect or your account is disabled temporarily.
*/
public function testGetCustomerAddressIfAccountIsNotConfirmed()
{
$query = $this->getQuery();

$userName = 'customer@example.com';
$password = 'password';

$customerToken = $this->customerTokenService->createCustomerAccessToken($userName, $password);
$headerMap = ['Authorization' => 'Bearer ' . $customerToken];

$this->graphQlQuery($query, [], '', $headerMap);
}

/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_address.php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,24 +345,6 @@ public function testUpdateAnotherCustomerAddress()
$this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
}

/**
* @magentoApiDataFixture Magento/Customer/_files/inactive_customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_address.php
* @magentoApiDataFixture Magento/Customer/_files/customer_confirmation_config_enable.php
* @expectedException Exception
* @expectedExceptionMessage The account sign-in was incorrect or your account is disabled temporarily.
*/
public function testUpdateCustomerAddressIfAccountIsNotConfirmed()
{
$userName = 'customer@needAconfirmation.com';
$password = 'password';
$addressId = 1;

$mutation = $this->getMutation($addressId);

$this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
}

/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_address.php
Expand Down

0 comments on commit d983e25

Please sign in to comment.