forked from DPDBaltics/PrestaShop-1.7
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from Invertus/DGS-142
Dgs 142 logic to change post code format for certain countries
- Loading branch information
Showing
7 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
use Invertus\dpdBaltics\Adapter\AddressAdapter; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class AddressAdapterTest extends TestCase | ||
{ | ||
/** | ||
* @dataProvider getPostCodeData | ||
*/ | ||
public function testFormatPostCodeByCountry($postCode, $isoCode, $expectedResult) | ||
{ | ||
|
||
$addressAdapter = new AddressAdapter(); | ||
$result = $addressAdapter->formatPostCodeByCountry($postCode, $isoCode); | ||
|
||
$this->assertEquals($expectedResult, $result); | ||
} | ||
|
||
public function getPostCodeData() | ||
{ | ||
yield 'Post code Lithuania' => [ | ||
'LT56120', | ||
'LT', | ||
'56120' | ||
]; | ||
yield 'Post code Ireland' => [ | ||
'V42 A393', | ||
'IE', | ||
'V42A393' | ||
]; | ||
yield 'Post code Estonia' => [ | ||
'10EE14A9', | ||
'EE', | ||
'10149' | ||
]; | ||
yield 'Post code Latvia' => [ | ||
'LV-1050', | ||
'LV', | ||
'1050' | ||
]; | ||
|
||
yield 'Post code UK' => [ | ||
'CH 65UZ', | ||
'GB', | ||
'CH65UZ' | ||
]; | ||
|
||
yield 'Post code NL' => [ | ||
'1012 AB', | ||
'NL', | ||
'1012AB' | ||
]; | ||
} | ||
} |