Skip to content

Commit d6d0bac

Browse files
committed
MTA-576: Re-factor Test for Create Customer on Backend
1 parent b4a1072 commit d6d0bac

File tree

101 files changed

+460
-1002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+460
-1002
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Catalog\Test\Page\Product\CatalogProductCompare;
1010
use Magento\Catalog\Test\Page\Product\CatalogProductView;
1111
use Magento\Cms\Test\Page\CmsIndex;
12-
use Magento\Customer\Test\Fixture\CustomerInjectable;
12+
use Magento\Customer\Test\Fixture\Customer;
1313
use Magento\Customer\Test\Page\CustomerAccountLogin;
1414
use Magento\Mtf\Client\BrowserInterface;
1515
use Magento\Mtf\Constraint\AbstractConstraint;
@@ -76,18 +76,18 @@ abstract class AbstractCompareProductsTest extends Injectable
7676
/**
7777
* Fixture customer.
7878
*
79-
* @var CustomerInjectable
79+
* @var Customer
8080
*/
8181
protected $customer;
8282

8383
/**
8484
* Prepare data.
8585
*
8686
* @param FixtureFactory $fixtureFactory
87-
* @param CustomerInjectable $customer
87+
* @param Customer $customer
8888
* @return void
8989
*/
90-
public function __prepare(FixtureFactory $fixtureFactory, CustomerInjectable $customer)
90+
public function __prepare(FixtureFactory $fixtureFactory, Customer $customer)
9191
{
9292
$this->fixtureFactory = $fixtureFactory;
9393
$customer->persist();

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Magento\Checkout\Test\Block\Cart;
88

9-
use Magento\Customer\Test\Fixture\AddressInjectable;
9+
use Magento\Customer\Test\Fixture\Address;
1010
use Magento\Mtf\Block\Form;
1111
use Magento\Mtf\Client\Locator;
1212

@@ -99,10 +99,10 @@ public function selectShippingMethod(array $shipping)
9999
/**
100100
* Fill shipping and tax form
101101
*
102-
* @param AddressInjectable $address
102+
* @param Address $address
103103
* @return void
104104
*/
105-
public function fillEstimateShippingAndTax(AddressInjectable $address)
105+
public function fillEstimateShippingAndTax(Address $address)
106106
{
107107
$this->openEstimateShippingAndTax();
108108
$this->fill($address);

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
namespace Magento\Checkout\Test\Block\Onepage;
88

9-
use Magento\Customer\Test\Fixture\AddressInjectable;
10-
use Magento\Customer\Test\Fixture\CustomerInjectable;
9+
use Magento\Customer\Test\Fixture\Address;
10+
use Magento\Customer\Test\Fixture\Customer;
1111
use Magento\Mtf\Block\Form;
1212

1313
/**
@@ -40,14 +40,14 @@ class Billing extends Form
4040
/**
4141
* Fill billing address
4242
*
43-
* @param AddressInjectable $billingAddress
44-
* @param CustomerInjectable $customer
43+
* @param Address $billingAddress
44+
* @param Customer $customer
4545
* @param bool $isShippingAddress
4646
* @return void
4747
*/
4848
public function fillBilling(
49-
AddressInjectable $billingAddress = null,
50-
CustomerInjectable $customer = null,
49+
Address $billingAddress = null,
50+
Customer $customer = null,
5151
$isShippingAddress = false
5252
) {
5353
if ($billingAddress) {

dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillBillingInformationStep.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
namespace Magento\Checkout\Test\TestStep;
88

99
use Magento\Checkout\Test\Page\CheckoutOnepage;
10-
use Magento\Customer\Test\Fixture\AddressInjectable;
11-
use Magento\Customer\Test\Fixture\CustomerInjectable;
10+
use Magento\Customer\Test\Fixture\Address;
11+
use Magento\Customer\Test\Fixture\Customer;
1212
use Magento\Mtf\TestStep\TestStepInterface;
1313

1414
/**
@@ -27,14 +27,14 @@ class FillBillingInformationStep implements TestStepInterface
2727
/**
2828
* Address fixture
2929
*
30-
* @var AddressInjectable
30+
* @var Address
3131
*/
3232
protected $billingAddress;
3333

3434
/**
3535
* Customer fixture
3636
*
37-
* @var CustomerInjectable
37+
* @var Customer
3838
*/
3939
protected $customer;
4040

@@ -48,14 +48,14 @@ class FillBillingInformationStep implements TestStepInterface
4848
/**
4949
* @constructor
5050
* @param CheckoutOnepage $checkoutOnepage
51-
* @param AddressInjectable $billingAddress
52-
* @param CustomerInjectable $customer
51+
* @param Address $billingAddress
52+
* @param Customer $customer
5353
* @param string $checkoutMethod
5454
*/
5555
public function __construct(
5656
CheckoutOnepage $checkoutOnepage,
57-
AddressInjectable $billingAddress,
58-
CustomerInjectable $customer,
57+
Address $billingAddress,
58+
Customer $customer,
5959
$checkoutMethod
6060
) {
6161
$this->checkoutOnepage = $checkoutOnepage;

dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Magento\Checkout\Test\TestStep;
88

99
use Magento\Checkout\Test\Page\CheckoutOnepage;
10-
use Magento\Customer\Test\Fixture\CustomerInjectable;
10+
use Magento\Customer\Test\Fixture\Customer;
1111
use Magento\Mtf\TestStep\TestStepInterface;
1212

1313
/**
@@ -33,17 +33,17 @@ class SelectCheckoutMethodStep implements TestStepInterface
3333
/**
3434
* Customer fixture
3535
*
36-
* @var CustomerInjectable
36+
* @var Customer
3737
*/
3838
protected $customer;
3939

4040
/**
4141
* @constructor
4242
* @param CheckoutOnepage $checkoutOnepage
43-
* @param CustomerInjectable $customer
43+
* @param Customer $customer
4444
* @param string $checkoutMethod
4545
*/
46-
public function __construct(CheckoutOnepage $checkoutOnepage, CustomerInjectable $customer, $checkoutMethod)
46+
public function __construct(CheckoutOnepage $checkoutOnepage, Customer $customer, $checkoutMethod)
4747
{
4848
$this->checkoutOnepage = $checkoutOnepage;
4949
$this->checkoutMethod = $checkoutMethod;

dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function processAssert(
6060
);
6161
$product = $createProductsStep->run();
6262

63-
$billingAddress = $fixtureFactory->createByCode('addressInjectable', ['dataSet' => 'default']);
63+
$billingAddress = $fixtureFactory->createByCode('address', ['dataSet' => 'default']);
6464

6565
$browser->open($_ENV['app_frontend_url'] . $product['products'][0]->getUrlKey() . '.html');
6666
$catalogProductView->getViewBlock()->clickAddToCartButton();

dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function processAssert(
7171
);
7272
$product = $createProductsStep->run();
7373

74-
$billingAddress = $fixtureFactory->createByCode('addressInjectable', ['dataSet' => 'default']);
74+
$billingAddress = $fixtureFactory->createByCode('address', ['dataSet' => 'default']);
7575

7676
$browser->open($_ENV['app_frontend_url'] . $product['products'][0]->getUrlKey() . '.html');
7777
$catalogProductView->getViewBlock()->clickAddToCartButton();

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AddressesAdditional.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\Customer\Test\Block\Account;
77

8-
use Magento\Customer\Test\Fixture\AddressInjectable;
8+
use Magento\Customer\Test\Fixture\Address;
99
use Magento\Mtf\Block\Block;
1010
use Magento\Mtf\Client\Locator;
1111

@@ -39,10 +39,10 @@ class AddressesAdditional extends Block
3939
/**
4040
* Delete Additional Address
4141
*
42-
* @param AddressInjectable $address
42+
* @param Address $address
4343
* @return void
4444
*/
45-
public function deleteAdditionalAddress(AddressInjectable $address)
45+
public function deleteAdditionalAddress(Address $address)
4646
{
4747
$this->_rootElement->find(sprintf($this->addressSelector, $address->getStreet()), Locator::SELECTOR_XPATH)
4848
->find($this->deleteAddressLink)->click();

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Address/Renderer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
namespace Magento\Customer\Test\Block\Address;
88

9-
use Magento\Customer\Test\Fixture\AddressInjectable;
9+
use Magento\Customer\Test\Fixture\Address;
1010

1111
/**
12-
* Render output from AddressInjectable fixture according to data format type.
12+
* Render output from Address fixture according to data format type.
1313
*/
1414
class Renderer
1515
{
@@ -21,18 +21,18 @@ class Renderer
2121
protected $type;
2222

2323
/**
24-
* AddressInjectable fixture.
24+
* Address fixture.
2525
*
26-
* @var AddressInjectable
26+
* @var Address
2727
*/
2828
protected $address;
2929

3030
/**
3131
* @constructor
32-
* @param AddressInjectable $address
32+
* @param Address $address
3333
* @param string $type
3434
*/
35-
public function __construct(AddressInjectable $address, $type = null)
35+
public function __construct(Address $address, $type = null)
3636
{
3737
$this->address = $address;
3838
$this->type = $type;

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Mtf\Block\Form;
1010
use Magento\Mtf\Client\Element\SimpleElement;
1111
use Magento\Mtf\Fixture\FixtureInterface;
12-
use Magento\Customer\Test\Fixture\CustomerInjectable;
12+
use Magento\Customer\Test\Fixture\Customer;
1313

1414
/**
1515
* Customer account edit form.
@@ -56,7 +56,7 @@ public function submit()
5656
*/
5757
public function fill(FixtureInterface $customer, SimpleElement $element = null)
5858
{
59-
/** @var CustomerInjectable $customer */
59+
/** @var Customer $customer */
6060
if ($customer->hasData()) {
6161
return parent::fill($customer, $element);
6262
}
@@ -65,10 +65,10 @@ public function fill(FixtureInterface $customer, SimpleElement $element = null)
6565
/**
6666
* Get all error validation messages for fields.
6767
*
68-
* @param CustomerInjectable $customer
68+
* @param Customer $customer
6969
* @return array
7070
*/
71-
public function getValidationMessages(CustomerInjectable $customer)
71+
public function getValidationMessages(Customer $customer)
7272
{
7373
$messages = [];
7474
foreach (array_keys($customer->getData()) as $field) {

0 commit comments

Comments
 (0)