Definition at line 10 of file ValidatorTest.php.
◆ getCanadaInvalidPostCodes()
getCanadaInvalidPostCodes |
( |
| ) |
|
- Returns
- array
Definition at line 64 of file ValidatorTest.php.
67 [
'countryId' =>
'CA',
'postcode' =>
'12345'],
68 [
'countryId' =>
'CA',
'postcode' =>
'A1B2C3D'],
69 [
'countryId' =>
'CA',
'postcode' =>
'A1B2C'],
70 [
'countryId' =>
'CA',
'postcode' =>
'A1B 2C3'],
◆ getCanadaValidPostCodes()
getCanadaValidPostCodes |
( |
| ) |
|
- Returns
- array
Definition at line 77 of file ValidatorTest.php.
80 [
'countryId' =>
'CA',
'postcode' =>
'A1B2C3'],
81 [
'countryId' =>
'CA',
'postcode' =>
'A1B 2C3'],
82 [
'countryId' =>
'CA',
'postcode' =>
'Z9Y 8X7'],
83 [
'countryId' =>
'CA',
'postcode' =>
'Z9Y8X7'],
◆ getPostcodesDataProvider()
getPostcodesDataProvider |
( |
| ) |
|
- Returns
- array @SuppressWarnings(PHPMD.ExcessiveMethodLength)
Definition at line 91 of file ValidatorTest.php.
94 [
'countryId' =>
'DZ',
'postcode' =>
'12345'],
95 [
'countryId' =>
'AS',
'postcode' =>
'12345'],
96 [
'countryId' =>
'AR',
'postcode' =>
'1234'],
97 [
'countryId' =>
'AM',
'postcode' =>
'123456'],
98 [
'countryId' =>
'AU',
'postcode' =>
'1234'],
99 [
'countryId' =>
'AT',
'postcode' =>
'1234'],
100 [
'countryId' =>
'AZ',
'postcode' =>
'1234'],
101 [
'countryId' =>
'AZ',
'postcode' =>
'123456'],
102 [
'countryId' =>
'BD',
'postcode' =>
'1234'],
103 [
'countryId' =>
'BY',
'postcode' =>
'123456'],
104 [
'countryId' =>
'BE',
'postcode' =>
'1234'],
105 [
'countryId' =>
'BA',
'postcode' =>
'12345'],
106 [
'countryId' =>
'BR',
'postcode' =>
'12345'],
107 [
'countryId' =>
'BR',
'postcode' =>
'12345-678'],
108 [
'countryId' =>
'BN',
'postcode' =>
'PS1234'],
109 [
'countryId' =>
'BG',
'postcode' =>
'1234'],
110 [
'countryId' =>
'CA',
'postcode' =>
'P9M 3T6'],
111 [
'countryId' =>
'IC',
'postcode' =>
'12345'],
112 [
'countryId' =>
'CN',
'postcode' =>
'123456'],
113 [
'countryId' =>
'HR',
'postcode' =>
'12345'],
114 [
'countryId' =>
'CU',
'postcode' =>
'12345'],
115 [
'countryId' =>
'CY',
'postcode' =>
'1234'],
116 [
'countryId' =>
'CZ',
'postcode' =>
'123 45'],
117 [
'countryId' =>
'DK',
'postcode' =>
'1234'],
118 [
'countryId' =>
'EE',
'postcode' =>
'12345'],
119 [
'countryId' =>
'FI',
'postcode' =>
'12345'],
120 [
'countryId' =>
'FR',
'postcode' =>
'12345'],
121 [
'countryId' =>
'GF',
'postcode' =>
'12345'],
122 [
'countryId' =>
'GE',
'postcode' =>
'1234'],
123 [
'countryId' =>
'DE',
'postcode' =>
'12345'],
124 [
'countryId' =>
'GR',
'postcode' =>
'123 45'],
125 [
'countryId' =>
'GL',
'postcode' =>
'1234'],
126 [
'countryId' =>
'GP',
'postcode' =>
'12345'],
127 [
'countryId' =>
'GU',
'postcode' =>
'12345'],
128 [
'countryId' =>
'GG',
'postcode' =>
'PL5 7TH'],
129 [
'countryId' =>
'HU',
'postcode' =>
'1234'],
130 [
'countryId' =>
'IS',
'postcode' =>
'123'],
131 [
'countryId' =>
'IN',
'postcode' =>
'123456'],
132 [
'countryId' =>
'ID',
'postcode' =>
'12345'],
133 [
'countryId' =>
'IL',
'postcode' =>
'1234567'],
134 [
'countryId' =>
'IT',
'postcode' =>
'12345'],
135 [
'countryId' =>
'JP',
'postcode' =>
'123-4567'],
136 [
'countryId' =>
'JP',
'postcode' =>
'1234567'],
137 [
'countryId' =>
'JE',
'postcode' =>
'TY8 9PL'],
138 [
'countryId' =>
'KZ',
'postcode' =>
'123456'],
139 [
'countryId' =>
'KE',
'postcode' =>
'12345'],
140 [
'countryId' =>
'KR',
'postcode' =>
'123-456'],
141 [
'countryId' =>
'KG',
'postcode' =>
'123456'],
142 [
'countryId' =>
'LV',
'postcode' =>
'1234'],
143 [
'countryId' =>
'LI',
'postcode' =>
'1234'],
144 [
'countryId' =>
'LT',
'postcode' =>
'12345'],
145 [
'countryId' =>
'LU',
'postcode' =>
'1234'],
146 [
'countryId' =>
'MK',
'postcode' =>
'1234'],
147 [
'countryId' =>
'MG',
'postcode' =>
'123'],
148 [
'countryId' =>
'MY',
'postcode' =>
'12345'],
149 [
'countryId' =>
'MV',
'postcode' =>
'12345'],
150 [
'countryId' =>
'MV',
'postcode' =>
'1234'],
151 [
'countryId' =>
'MT',
'postcode' =>
'WRT 123'],
152 [
'countryId' =>
'MT',
'postcode' =>
'WRT 45'],
153 [
'countryId' =>
'MH',
'postcode' =>
'12345'],
154 [
'countryId' =>
'MQ',
'postcode' =>
'12345'],
155 [
'countryId' =>
'MX',
'postcode' =>
'12345'],
156 [
'countryId' =>
'MD',
'postcode' =>
'1234'],
157 [
'countryId' =>
'MC',
'postcode' =>
'12345'],
158 [
'countryId' =>
'MN',
'postcode' =>
'123456'],
159 [
'countryId' =>
'MA',
'postcode' =>
'12345'],
160 [
'countryId' =>
'NL',
'postcode' =>
'1234 TR'],
161 [
'countryId' =>
'NO',
'postcode' =>
'1234'],
162 [
'countryId' =>
'PK',
'postcode' =>
'12345'],
163 [
'countryId' =>
'PH',
'postcode' =>
'1234'],
164 [
'countryId' =>
'PL',
'postcode' =>
'12-345'],
165 [
'countryId' =>
'PT',
'postcode' =>
'1234'],
166 [
'countryId' =>
'PT',
'postcode' =>
'1234-567'],
167 [
'countryId' =>
'PR',
'postcode' =>
'12345'],
168 [
'countryId' =>
'RE',
'postcode' =>
'12345'],
169 [
'countryId' =>
'RO',
'postcode' =>
'123456'],
170 [
'countryId' =>
'RU',
'postcode' =>
'123456'],
171 [
'countryId' =>
'MP',
'postcode' =>
'12345'],
172 [
'countryId' =>
'CS',
'postcode' =>
'12345'],
173 [
'countryId' =>
'SG',
'postcode' =>
'123456'],
174 [
'countryId' =>
'SK',
'postcode' =>
'123 45'],
175 [
'countryId' =>
'SI',
'postcode' =>
'1234'],
176 [
'countryId' =>
'ZA',
'postcode' =>
'1234'],
177 [
'countryId' =>
'ES',
'postcode' =>
'12345'],
178 [
'countryId' =>
'XY',
'postcode' =>
'12345'],
179 [
'countryId' =>
'SZ',
'postcode' =>
'R123'],
180 [
'countryId' =>
'SE',
'postcode' =>
'123 45'],
181 [
'countryId' =>
'CH',
'postcode' =>
'1234'],
182 [
'countryId' =>
'TW',
'postcode' =>
'123'],
183 [
'countryId' =>
'TW',
'postcode' =>
'12345'],
184 [
'countryId' =>
'TJ',
'postcode' =>
'123456'],
185 [
'countryId' =>
'TH',
'postcode' =>
'12345'],
186 [
'countryId' =>
'TR',
'postcode' =>
'12345'],
187 [
'countryId' =>
'TM',
'postcode' =>
'123456'],
188 [
'countryId' =>
'UA',
'postcode' =>
'12345'],
189 [
'countryId' =>
'GB',
'postcode' =>
'PL12 3RT'],
190 [
'countryId' =>
'GB',
'postcode' =>
'P1L 2RT'],
191 [
'countryId' =>
'GB',
'postcode' =>
'QW1 2RT'],
192 [
'countryId' =>
'GB',
'postcode' =>
'QW1R 2TG'],
193 [
'countryId' =>
'GB',
'postcode' =>
'L12 3PL'],
194 [
'countryId' =>
'GB',
'postcode' =>
'Q1 2PL'],
195 [
'countryId' =>
'US',
'postcode' =>
'12345-6789'],
196 [
'countryId' =>
'US',
'postcode' =>
'12345'],
197 [
'countryId' =>
'UY',
'postcode' =>
'12345'],
198 [
'countryId' =>
'UZ',
'postcode' =>
'123456'],
199 [
'countryId' =>
'VI',
'postcode' =>
'12345'],
◆ setUp()
◆ testInvalidCanadaZipCode()
testInvalidCanadaZipCode |
( |
|
$countryId, |
|
|
|
$invalidPostCode |
|
) |
| |
@dataProvider getCanadaInvalidPostCodes
Definition at line 48 of file ValidatorTest.php.
50 $this->assertFalse($this->validator->validate($invalidPostCode, $countryId));
◆ testPostCodes()
testPostCodes |
( |
|
$countryId, |
|
|
|
$validPostcode |
|
) |
| |
@dataProvider getPostcodesDataProvider
Definition at line 26 of file ValidatorTest.php.
29 $this->assertTrue($this->validator->validate($validPostcode, $countryId));
30 $this->assertFalse($this->validator->validate(
'INVALID-100', $countryId));
31 }
catch (\InvalidArgumentException $ex) {
◆ testPostCodesThrowsExceptionIfCountryDoesNotExist()
testPostCodesThrowsExceptionIfCountryDoesNotExist |
( |
| ) |
|
@expectedException \InvalidArgumentException @expectedExceptionMessage Provided countryId does not exist.
Definition at line 40 of file ValidatorTest.php.
42 $this->validator->validate(
'12345',
'INVALID-CODE');
◆ testValidCanadaZipCode()
testValidCanadaZipCode |
( |
|
$countryId, |
|
|
|
$validPostCode |
|
) |
| |
@dataProvider getCanadaValidPostCodes
Definition at line 56 of file ValidatorTest.php.
58 $this->assertTrue($this->validator->validate($validPostCode, $countryId));
◆ $validator
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php