Skip to content

Commit 1e0118d

Browse files
Merge remote-tracking branch 'origin/MC-38476' into MC-38663
2 parents 8653503 + 5448cbc commit 1e0118d

File tree

2 files changed

+16
-5
lines changed
  • app/code/Magento/Directory/etc
  • dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/Config

2 files changed

+16
-5
lines changed

app/code/Magento/Directory/etc/zip_codes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<zip countryCode="AR">
2020
<codes>
2121
<code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code>
22+
<code id="pattern_2" active="true" example="A1234BCD">^[a-zA-z]{1}[0-9]{4}[a-zA-z]{3}$</code>
2223
</codes>
2324
</zip>
2425
<zip countryCode="AM">

dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/Config/ReaderTest.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66

77
namespace Magento\Directory\Model\Country\Postcode\Config;
88

9-
class ReaderTest extends \PHPUnit\Framework\TestCase
9+
use Magento\TestFramework\Helper\Bootstrap;
10+
use PHPUnit\Framework\TestCase;
11+
12+
class ReaderTest extends TestCase
1013
{
1114
/**
12-
* @var \Magento\Directory\Model\Country\Postcode\Config\Reader
15+
* @var Reader
1316
*/
1417
private $reader;
1518

1619
protected function setUp(): void
1720
{
18-
$this->reader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
19-
\Magento\Directory\Model\Country\Postcode\Config\Reader::class
20-
);
21+
$this->reader = Bootstrap::getObjectManager()
22+
->create(Reader::class);
2123
}
2224

2325
public function testRead()
@@ -39,5 +41,13 @@ public function testRead()
3941

4042
$this->assertEquals('test1', $result['NL_NEW']['pattern_1']['example']);
4143
$this->assertEquals('^[0-2]{4}[A-Z]{2}$', $result['NL_NEW']['pattern_1']['pattern']);
44+
45+
$this->assertArrayHasKey('AR', $result);
46+
$this->assertArrayHasKey('pattern_1', $result['AR']);
47+
$this->assertArrayHasKey('pattern_2', $result['AR']);
48+
$this->assertEquals('1234', $result['AR']['pattern_1']['example']);
49+
$this->assertEquals('^[0-9]{4}$', $result['AR']['pattern_1']['pattern']);
50+
$this->assertEquals('A1234BCD', $result['AR']['pattern_2']['example']);
51+
$this->assertEquals('^[a-zA-z]{1}[0-9]{4}[a-zA-z]{3}$', $result['AR']['pattern_2']['pattern']);
4252
}
4353
}

0 commit comments

Comments
 (0)