From bf18e7a5b5d8cf7c81e308d25049209b8e0efb90 Mon Sep 17 00:00:00 2001 From: vitaliyboyko Date: Thu, 17 May 2018 22:17:06 +0300 Subject: [PATCH 01/17] Fix typo in database column comment --- app/code/Magento/Catalog/Setup/InstallSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Setup/InstallSchema.php b/app/code/Magento/Catalog/Setup/InstallSchema.php index d82f595600ce2..2307e848f00b4 100644 --- a/app/code/Magento/Catalog/Setup/InstallSchema.php +++ b/app/code/Magento/Catalog/Setup/InstallSchema.php @@ -674,7 +674,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, null, ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Attriute Set ID' + 'Attribute Set ID' ) ->addColumn( 'parent_id', From 228b765cbc4fb7207a90413f30e99d42ec741c7d Mon Sep 17 00:00:00 2001 From: Markus Haack Date: Tue, 5 Jun 2018 13:32:18 +0200 Subject: [PATCH 02/17] Update webapi.xml to fix typo --- app/code/Magento/Checkout/etc/webapi.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/etc/webapi.xml b/app/code/Magento/Checkout/etc/webapi.xml index 7b435db200f19..26c601a4e9f38 100644 --- a/app/code/Magento/Checkout/etc/webapi.xml +++ b/app/code/Magento/Checkout/etc/webapi.xml @@ -104,7 +104,7 @@ - + From 6ab1020c87ef56c05a69c9be064ad3395d4d7009 Mon Sep 17 00:00:00 2001 From: Rahul Kachhadiya Date: Wed, 6 Jun 2018 14:47:03 +0530 Subject: [PATCH 03/17] Added language translation in template files --- app/code/Magento/Braintree/i18n/en_US.csv | 3 ++- .../Magento/Braintree/view/adminhtml/templates/form/cc.phtml | 2 +- app/code/Magento/Paypal/i18n/en_US.csv | 1 + .../Paypal/view/adminhtml/templates/transparent/form.phtml | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Braintree/i18n/en_US.csv b/app/code/Magento/Braintree/i18n/en_US.csv index f5e2d36e1e9bb..bce38100b9e33 100644 --- a/app/code/Magento/Braintree/i18n/en_US.csv +++ b/app/code/Magento/Braintree/i18n/en_US.csv @@ -165,4 +165,5 @@ Debug,Debug "credit_card","Credit card" "apple_pay_card","Apple pay card" "android_pay_card","Android pay card" -"Accept credit/debit cards and PayPal in your Magento store.
No setup or monthly fees and your customers never leave your store to complete the purchase.","Accept credit/debit cards and PayPal in your Magento store.
No setup or monthly fees and your customers never leave your store to complete the purchase." \ No newline at end of file +"Accept credit/debit cards and PayPal in your Magento store.
No setup or monthly fees and your customers never leave your store to complete the purchase.","Accept credit/debit cards and PayPal in your Magento store.
No setup or monthly fees and your customers never leave your store to complete the purchase." +"Save for later use.","Save for later use." diff --git a/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml index b039d4287a2e8..76a4a28307e26 100644 --- a/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml +++ b/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml @@ -84,7 +84,7 @@ $ccType = $block->getInfoData('cc_type'); name="payment[is_active_payment_token_enabler]" class="admin__control-checkbox"/> diff --git a/app/code/Magento/Paypal/i18n/en_US.csv b/app/code/Magento/Paypal/i18n/en_US.csv index 4686c4a9004f3..02eb325a808d0 100644 --- a/app/code/Magento/Paypal/i18n/en_US.csv +++ b/app/code/Magento/Paypal/i18n/en_US.csv @@ -680,3 +680,4 @@ User,User "payflowpro","Payflow Pro" "Payments Pro","Payments Pro" "Website Payments Pro","Website Payments Pro" +"Save for later use.","Save for later use." diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/transparent/form.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/transparent/form.phtml index 8b050405cdaf2..8fdee5264bf62 100644 --- a/app/code/Magento/Paypal/view/adminhtml/templates/transparent/form.phtml +++ b/app/code/Magento/Paypal/view/adminhtml/templates/transparent/form.phtml @@ -135,7 +135,7 @@ $ccExpMonth = $block->getInfoData('cc_exp_month'); name="payment[is_active_payment_token_enabler]" class="admin__control-checkbox"/> From fc35b01e7eb7c6b3cf13538504c5a601a6b98859 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Tue, 5 Jun 2018 20:42:44 +0200 Subject: [PATCH 04/17] chore: remove unused less import --- lib/web/css/docs/source/docs.less | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/web/css/docs/source/docs.less b/lib/web/css/docs/source/docs.less index 4039d0562da53..952beb5c0f970 100644 --- a/lib/web/css/docs/source/docs.less +++ b/lib/web/css/docs/source/docs.less @@ -21,7 +21,6 @@ @import '_icons.less'; @import '_loaders.less'; @import '_messages.less'; -//@import 'navigation.less'; @import '_layout.less'; @import '_pages.less'; @import '_popups.less'; From 6c6d67f4c389e2e3d851f041333d423d898c211a Mon Sep 17 00:00:00 2001 From: David Date: Fri, 30 Mar 2018 21:21:10 -0400 Subject: [PATCH 05/17] Update Config.php --- lib/internal/Magento/Framework/Locale/Config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Locale/Config.php b/lib/internal/Magento/Framework/Locale/Config.php index 2f4b0fcee01a5..a710561daeb8e 100644 --- a/lib/internal/Magento/Framework/Locale/Config.php +++ b/lib/internal/Magento/Framework/Locale/Config.php @@ -98,6 +98,7 @@ class Config implements \Magento\Framework\Locale\ConfigInterface 'lo_LA', /*Laotian*/ 'es_VE', /*Spanish (Venezuela)*/ 'en_IE', /*English (Ireland)*/ + 'es_BO', /*Spanish (Bolivia)*/ ]; /** From 6027744804dd7faab0d75a96eca0aefd97f27b38 Mon Sep 17 00:00:00 2001 From: Prince Patel Date: Sun, 25 Mar 2018 16:03:38 +0530 Subject: [PATCH 06/17] Format code --- app/code/Magento/Review/etc/adminhtml/menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Review/etc/adminhtml/menu.xml b/app/code/Magento/Review/etc/adminhtml/menu.xml index 2ed92a48ad421..e3532483f88af 100644 --- a/app/code/Magento/Review/etc/adminhtml/menu.xml +++ b/app/code/Magento/Review/etc/adminhtml/menu.xml @@ -9,7 +9,7 @@ - + From 6257807c41e2d280fb9fb35cfa1e87e4a9bc0bc6 Mon Sep 17 00:00:00 2001 From: Calin Diacon Date: Sat, 24 Mar 2018 18:43:43 +0000 Subject: [PATCH 07/17] precision for price overriding by js --- app/code/Magento/Catalog/view/base/web/js/price-utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/base/web/js/price-utils.js b/app/code/Magento/Catalog/view/base/web/js/price-utils.js index 36269ab1d241b..4d3747a108068 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-utils.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-utils.js @@ -70,7 +70,7 @@ define([ am = Number(Math.round(Math.abs(amount - i) + 'e+' + precision) + ('e-' + precision)); r = (j ? i.substr(0, j) + groupSymbol : '') + i.substr(j).replace(re, '$1' + groupSymbol) + - (precision ? decimalSymbol + am.toFixed(2).replace(/-/, 0).slice(2) : ''); + (precision ? decimalSymbol + am.toFixed(precision).replace(/-/, 0).slice(2) : ''); return pattern.replace('%s', r).replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } From 0658873f52db5e34049952eac2efdf009d3d8698 Mon Sep 17 00:00:00 2001 From: Oscar Recio Date: Sat, 24 Mar 2018 12:22:21 +0100 Subject: [PATCH 08/17] Add both locale code: ms_MY and ms_Latn_MY --- lib/internal/Magento/Framework/Locale/Config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Locale/Config.php b/lib/internal/Magento/Framework/Locale/Config.php index 2f4b0fcee01a5..83673ae285a00 100644 --- a/lib/internal/Magento/Framework/Locale/Config.php +++ b/lib/internal/Magento/Framework/Locale/Config.php @@ -72,6 +72,7 @@ class Config implements \Magento\Framework\Locale\ConfigInterface 'mk_MK', /*Macedonian (Macedonia)*/ 'mn_Cyrl_MN', /*Mongolian (Mongolia)*/ 'ms_Latn_MY', /*Malaysian (Malaysia)*/ + 'ms_MY', /*Malaysian (Malaysia)*/ 'nl_BE', /*Dutch (Belgium)*/ 'nl_NL', /*Dutch (Netherlands)*/ 'nb_NO', /*Norwegian BokmГ_l (Norway)*/ From 4caef44ca281c55bdc2d110437aab490ed9e02da Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Thu, 7 Jun 2018 14:12:31 +0200 Subject: [PATCH 09/17] Do not display anchor if menu has no children --- app/code/Magento/Backend/Block/Menu.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Backend/Block/Menu.php b/app/code/Magento/Backend/Block/Menu.php index 9521071027e7e..c290177baeaf6 100644 --- a/app/code/Magento/Backend/Block/Menu.php +++ b/app/code/Magento/Backend/Block/Menu.php @@ -211,9 +211,12 @@ protected function _renderItemCssClass($menuItem, $level) protected function _renderAnchor($menuItem, $level) { if ($level == 1 && $menuItem->getUrl() == '#') { - $output = '' - . '' . $this->_getAnchorLabel($menuItem) . '' - . ''; + $output = ''; + if ($menuItem->hasChildren()) { + $output = '' + . '' . $this->_getAnchorLabel($menuItem) . '' + . ''; + } } else { $output = '_renderItemAnchorTitle( $menuItem From 63ebb61a6278e74590644226a5311fe8435f7259 Mon Sep 17 00:00:00 2001 From: NamrataChangani Date: Wed, 6 Jun 2018 15:51:04 +0530 Subject: [PATCH 10/17] Wrong annotation in _toOptionArray : lib\internal\Magento\Framework\Data\SearchResultProcessor.php --- lib/internal/Magento/Framework/Data/SearchResultProcessor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Data/SearchResultProcessor.php b/lib/internal/Magento/Framework/Data/SearchResultProcessor.php index 5321ce06755cf..8bb4c3dcde474 100644 --- a/lib/internal/Magento/Framework/Data/SearchResultProcessor.php +++ b/lib/internal/Magento/Framework/Data/SearchResultProcessor.php @@ -188,8 +188,8 @@ public function toArray($arrRequiredFields = []) } /** - * @param null $valueField - * @param null $labelField + * @param string $labelField + * @param string $labelField * @param array $additional * @return array */ From 3c583901308169425d88c7c1064ea4d67f532e86 Mon Sep 17 00:00:00 2001 From: NamrataChangani Date: Wed, 6 Jun 2018 15:54:52 +0530 Subject: [PATCH 11/17] Wrong annotation in _toOptionArray : lib\internal\Magento\Framework\Data\SearchResultProcessor.php #2 --- lib/internal/Magento/Framework/Data/SearchResultProcessor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Data/SearchResultProcessor.php b/lib/internal/Magento/Framework/Data/SearchResultProcessor.php index 8bb4c3dcde474..fc7cc2f98a1ef 100644 --- a/lib/internal/Magento/Framework/Data/SearchResultProcessor.php +++ b/lib/internal/Magento/Framework/Data/SearchResultProcessor.php @@ -188,8 +188,8 @@ public function toArray($arrRequiredFields = []) } /** - * @param string $labelField - * @param string $labelField + * @param string|null $valueField + * @param string|null $labelField * @param array $additional * @return array */ From f3108a35c0127b77b65608d55150d255b14d9e4a Mon Sep 17 00:00:00 2001 From: Jakub Idziak Date: Fri, 18 May 2018 16:07:40 +0200 Subject: [PATCH 12/17] ISSUE-11477 - fixed Swagger response for searchCriteria - added zero index to array signifier --- app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php index 9a4c174c3b88e..747c16b8d3179 100644 --- a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php +++ b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php @@ -39,7 +39,7 @@ class Generator extends AbstractSchemaGenerator const UNAUTHORIZED_DESCRIPTION = '401 Unauthorized'; /** Array signifier */ - const ARRAY_SIGNIFIER = '[]'; + const ARRAY_SIGNIFIER = '[0]'; /** * Swagger factory instance. From 063840f809aa622d48803548a0c9a1c03e0f5f82 Mon Sep 17 00:00:00 2001 From: Saurabh Parekh Date: Wed, 6 Jun 2018 15:36:35 +0530 Subject: [PATCH 13/17] No need to pass method parameter as method definition does not require it --- app/code/Magento/UrlRewrite/Block/Catalog/Product/Edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/UrlRewrite/Block/Catalog/Product/Edit.php b/app/code/Magento/UrlRewrite/Block/Catalog/Product/Edit.php index d18060abe2245..1fcabe71bd5d8 100644 --- a/app/code/Magento/UrlRewrite/Block/Catalog/Product/Edit.php +++ b/app/code/Magento/UrlRewrite/Block/Catalog/Product/Edit.php @@ -55,7 +55,7 @@ protected function _prepareLayoutFeatures() } if ($this->_getProduct()->getId()) { - $this->_addProductLinkBlock($this->_getProduct()); + $this->_addProductLinkBlock(); } if ($this->_getCategory()->getId()) { From bc26a3a132fba7aae4be6095411b212b03c9c93d Mon Sep 17 00:00:00 2001 From: Tadeo Barranco Date: Fri, 2 Mar 2018 15:55:05 -0600 Subject: [PATCH 14/17] #13899 Solve Zipcode pattern for Canada --- app/code/Magento/Directory/etc/zip_codes.xml | 1 + .../Model/Country/Postcode/ValidatorTest.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/app/code/Magento/Directory/etc/zip_codes.xml b/app/code/Magento/Directory/etc/zip_codes.xml index 18e13ca5bb48b..c4899636b4b30 100644 --- a/app/code/Magento/Directory/etc/zip_codes.xml +++ b/app/code/Magento/Directory/etc/zip_codes.xml @@ -81,6 +81,7 @@ ^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}\s[0-9]{1}[a-zA-z]{1}[0-9]{1}$ + ^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}[0-9]{1}$ diff --git a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php index ad2e6c6c4e235..d09879131a353 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php @@ -42,6 +42,24 @@ public function testPostCodesThrowsExceptionIfCountryDoesNotExist() $this->validator->validate('12345', 'INVALID-CODE'); } + public function testInvalidCanadaZipCode() { + $resultOnlyDigits = $this->validator->validate('12345', 'CA'); + $resultMoreCharactersThanNeeded = $this->validator->validate('A1B2C3D', 'CA'); + $resultLessCharactersThanNeeded = $this->validator->validate('A1B2C', 'CA'); + $resultMoreThanOneSpace = $this->validator->validate('A1B 2C3', 'CA'); + $this->assertFalse($resultOnlyDigits); + $this->assertFalse($resultMoreCharactersThanNeeded); + $this->assertFalse($resultLessCharactersThanNeeded); + $this->assertFalse($resultMoreThanOneSpace); + } + + public function testValidCanadaZipCode() { + $resultPattern1 = $this->validator->validate('A1B2C3', 'CA'); + $resultPattern2 = $this->validator->validate('A1B 2C3', 'CA'); + $this->assertTrue($resultPattern1); + $this->assertTrue($resultPattern2); + } + /** * @return array * @SuppressWarnings(PHPMD.ExcessiveMethodLength) From 8f03ac9aee1cad032cbc45f128fa9d86aa0e918b Mon Sep 17 00:00:00 2001 From: Tadeo Barranco Date: Fri, 2 Mar 2018 16:08:25 -0600 Subject: [PATCH 15/17] #13899 Improve unit test --- .../Model/Country/Postcode/ValidatorTest.php | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php index d09879131a353..6c574ddac81c6 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php @@ -42,17 +42,16 @@ public function testPostCodesThrowsExceptionIfCountryDoesNotExist() $this->validator->validate('12345', 'INVALID-CODE'); } - public function testInvalidCanadaZipCode() { - $resultOnlyDigits = $this->validator->validate('12345', 'CA'); - $resultMoreCharactersThanNeeded = $this->validator->validate('A1B2C3D', 'CA'); - $resultLessCharactersThanNeeded = $this->validator->validate('A1B2C', 'CA'); - $resultMoreThanOneSpace = $this->validator->validate('A1B 2C3', 'CA'); - $this->assertFalse($resultOnlyDigits); - $this->assertFalse($resultMoreCharactersThanNeeded); - $this->assertFalse($resultLessCharactersThanNeeded); - $this->assertFalse($resultMoreThanOneSpace); + /** + * @dataProvider getCanadaInvalidPostCodes + */ + public function testInvalidCanadaZipCode($countryId, $invalidPostCode) { + $this->assertFalse($this->validator->validate($invalidPostCode, $countryId)); } + /** + * + */ public function testValidCanadaZipCode() { $resultPattern1 = $this->validator->validate('A1B2C3', 'CA'); $resultPattern2 = $this->validator->validate('A1B 2C3', 'CA'); @@ -60,6 +59,18 @@ public function testValidCanadaZipCode() { $this->assertTrue($resultPattern2); } + /** + * @return array + */ + public function getCanadaInvalidPostCodes() { + return [ + ['countryId' => 'CA', 'postcode' => '12345'], + ['countryId' => 'CA', 'postcode' => 'A1B2C3D'], + ['countryId' => 'CA', 'postcode' => 'A1B2C'], + ['countryId' => 'CA', 'postcode' => 'A1B 2C3'], + ]; + } + /** * @return array * @SuppressWarnings(PHPMD.ExcessiveMethodLength) From 2587e0f5f11405aedc431d71542db2ae85af9522 Mon Sep 17 00:00:00 2001 From: Tadeo Barranco Date: Fri, 2 Mar 2018 16:09:26 -0600 Subject: [PATCH 16/17] #13899 Improve unit test --- .../Model/Country/Postcode/ValidatorTest.php | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php index 6c574ddac81c6..a2287bafdb9f1 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php @@ -50,13 +50,10 @@ public function testInvalidCanadaZipCode($countryId, $invalidPostCode) { } /** - * + * @dataProvider getCanadaValidPostCodes */ - public function testValidCanadaZipCode() { - $resultPattern1 = $this->validator->validate('A1B2C3', 'CA'); - $resultPattern2 = $this->validator->validate('A1B 2C3', 'CA'); - $this->assertTrue($resultPattern1); - $this->assertTrue($resultPattern2); + public function testValidCanadaZipCode($countryId, $validPostCode) { + $this->assertTrue($this->validator->validate($validPostCode, $countryId)); } /** @@ -71,6 +68,18 @@ public function getCanadaInvalidPostCodes() { ]; } + /** + * @return array + */ + public function getCanadaValidPostCodes() { + return [ + ['countryId' => 'CA', 'postcode' => 'A1B2C3'], + ['countryId' => 'CA', 'postcode' => 'A1B 2C3'], + ['countryId' => 'CA', 'postcode' => 'Z9Y 8X7'], + ['countryId' => 'CA', 'postcode' => 'Z9Y8X7'], + ]; + } + /** * @return array * @SuppressWarnings(PHPMD.ExcessiveMethodLength) From e7db1306f8785684649a06c49a229ddb0f57f641 Mon Sep 17 00:00:00 2001 From: Tadeo Barranco Date: Fri, 2 Mar 2018 16:38:57 -0600 Subject: [PATCH 17/17] Fixing failures in the test file --- .../Model/Country/Postcode/ValidatorTest.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php index a2287bafdb9f1..d2274c2169145 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php @@ -45,21 +45,24 @@ public function testPostCodesThrowsExceptionIfCountryDoesNotExist() /** * @dataProvider getCanadaInvalidPostCodes */ - public function testInvalidCanadaZipCode($countryId, $invalidPostCode) { + public function testInvalidCanadaZipCode($countryId, $invalidPostCode) + { $this->assertFalse($this->validator->validate($invalidPostCode, $countryId)); } /** * @dataProvider getCanadaValidPostCodes */ - public function testValidCanadaZipCode($countryId, $validPostCode) { + public function testValidCanadaZipCode($countryId, $validPostCode) + { $this->assertTrue($this->validator->validate($validPostCode, $countryId)); } /** * @return array */ - public function getCanadaInvalidPostCodes() { + public function getCanadaInvalidPostCodes() + { return [ ['countryId' => 'CA', 'postcode' => '12345'], ['countryId' => 'CA', 'postcode' => 'A1B2C3D'], @@ -71,7 +74,8 @@ public function getCanadaInvalidPostCodes() { /** * @return array */ - public function getCanadaValidPostCodes() { + public function getCanadaValidPostCodes() + { return [ ['countryId' => 'CA', 'postcode' => 'A1B2C3'], ['countryId' => 'CA', 'postcode' => 'A1B 2C3'],