From 628044a505765ee253eb6621528bcf66ec1ea876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Gro=C3=9Fe?= Date: Tue, 14 Jan 2020 13:17:52 +0100 Subject: [PATCH] introduce vat faker --- tests/functional/Customer/CustomerCest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/functional/Customer/CustomerCest.php b/tests/functional/Customer/CustomerCest.php index 31a1d7c0c..b3c0f9256 100644 --- a/tests/functional/Customer/CustomerCest.php +++ b/tests/functional/Customer/CustomerCest.php @@ -33,7 +33,8 @@ class CustomerCest public function updateCustomerAddress(FunctionalTester $I) { - $faker = Faker\Factory::create(); + $I->wantTo('Instantiate a european faker factory to have the vat provider available'); + $faker = Faker\Factory::create('at_AT'); $formCssSelector = '#customer-address-form'; @@ -49,7 +50,7 @@ class CustomerCest $this->fields = [ 'company_name' => $faker->company, - 'vat_id' => $faker->randomNumber(9), + 'vat_id' => 'INVALIDVAT', 'address1[]' => $faker->streetAddress, 'country' => $faker->countryCode, 'state' => $faker->state, @@ -77,8 +78,8 @@ class CustomerCest $I->submitForm($formCssSelector, $this->fields); $I->seeInSource('The given vat id has a wrong format'); - // valid vat id: - $this->fields['vat_id'] = 'DE123456789'; + $I->wantTo('enter a valid vat id'); + $this->fields['vat_id'] = $faker->vat(false); $I->submitForm($formCssSelector, $this->fields);