introduce vat faker

This commit is contained in:
David Große 2020-01-14 13:17:52 +01:00
parent e0b0740a83
commit 628044a505
1 changed files with 5 additions and 4 deletions

View File

@ -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);