Skip to content

Commit

Permalink
Merge branch 'krzaczek-issue-84'
Browse files Browse the repository at this point in the history
Closing PR #85 and issue #82
  • Loading branch information
DragonBe committed Nov 11, 2019
2 parents 0b3edb8 + 2b6fbba commit ada7e59
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
27 changes: 27 additions & 0 deletions src/Vies/Validator/ValidatorEU.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare (strict_types=1);

/**
* \DragonBe\Vies
*
* @author Paweł Krzaczkowski <krzaczek+github@gmail.com>
* @license MIT
*/

namespace DragonBe\Vies\Validator;

/**
* Class ValidatorEU
* @package DragonBe\Vies\Validator
*/
class ValidatorEU extends ValidatorAbstract
{
/**
* {@inheritdoc}
*/
public function validate(string $vatNumber): bool
{
return false;
}
}
3 changes: 2 additions & 1 deletion src/Vies/Vies.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Vies
const VIES_PROTO = 'http';
const VIES_DOMAIN = 'ec.europa.eu';
const VIES_WSDL = '/taxation_customs/vies/checkVatService.wsdl';
const VIES_EU_COUNTRY_TOTAL = 28;
const VIES_EU_COUNTRY_TOTAL = 29;

protected const VIES_EU_COUNTRY_LIST = [
'AT' => ['name' => 'Austria', 'validator' => Validator\ValidatorAT::class],
Expand Down Expand Up @@ -80,6 +80,7 @@ class Vies
'SI' => ['name' => 'Slovenia', 'validator' => Validator\ValidatorSI::class],
'SK' => ['name' => 'Slovakia', 'validator' => Validator\ValidatorSK::class],
'GB' => ['name' => 'United Kingdom', 'validator' => Validator\ValidatorGB::class],
'EU' => ['name' => 'MOSS Number', 'validator' => Validator\ValidatorEU::class],
];

/**
Expand Down
26 changes: 26 additions & 0 deletions tests/Vies/Validator/ValidatorEUTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare (strict_types=1);

namespace DragonBe\Test\Vies\Validator;

class ValidatorEUTest extends AbstractValidatorTest
{
/**
* @covers \DragonBe\Vies\Validator\ValidatorEU
* @dataProvider vatNumberProvider
*/
public function testValidator(string $vatNumber, bool $state)
{
$this->validateVatNumber('EU', $vatNumber, $state);
}

public function vatNumberProvider()
{
return [
['372009975', false],
['826409867', false],
['528003555', false],
];
}
}

0 comments on commit ada7e59

Please sign in to comment.