From f9cd5fa1737e944b01efa639db1f93b45696e71c Mon Sep 17 00:00:00 2001 From: stollr Date: Tue, 11 Feb 2025 09:33:04 +0100 Subject: [PATCH 1/2] Added app isolation attribute to tests in EavSetupTest because the affect global state (adding error messages to the `Magento\Eav\Model\Validator\Attribute\Code` service) which will affect further tests that try to add eav attributes. This change fixes #39616. --- .../integration/testsuite/Magento/Eav/Setup/EavSetupTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/Eav/Setup/EavSetupTest.php b/dev/tests/integration/testsuite/Magento/Eav/Setup/EavSetupTest.php index 17f9f481be78e..ea7f90176efb7 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Setup/EavSetupTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Setup/EavSetupTest.php @@ -6,6 +6,8 @@ namespace Magento\Eav\Setup; +use Magento\TestFramework\Fixture\AppIsolation; + /** * Test class for Magento\Eav\Setup\EavSetup. * @magentoDbIsolation enabled @@ -66,6 +68,7 @@ public static function addAttributeDataProvider() * * @dataProvider addAttributeThrowExceptionDataProvider */ + #[AppIsolation(true)] public function testAddAttributeThrowException($attributeCode) { $this->expectException(\Magento\Framework\Exception\LocalizedException::class); @@ -98,6 +101,7 @@ public static function addAttributeThrowExceptionDataProvider() * * @dataProvider addInvalidAttributeThrowExceptionDataProvider */ + #[AppIsolation(true)] public function testAddInvalidAttributeThrowException($attributeCode) { $this->expectException(\Magento\Framework\Exception\LocalizedException::class); From fa649ae25b722f7007c18c5b07224307d6f8511e Mon Sep 17 00:00:00 2001 From: stollr Date: Thu, 13 Feb 2025 11:53:24 +0100 Subject: [PATCH 2/2] Fixed code style issues in EavSetupTest --- .../testsuite/Magento/Eav/Setup/EavSetupTest.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Eav/Setup/EavSetupTest.php b/dev/tests/integration/testsuite/Magento/Eav/Setup/EavSetupTest.php index ea7f90176efb7..01ae98fe69c82 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Setup/EavSetupTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Setup/EavSetupTest.php @@ -1,9 +1,8 @@ expectException(\Magento\Framework\Exception\LocalizedException::class); - $this->expectExceptionMessage('Please use only letters (a-z or A-Z), numbers (0-9) or underscore (_) in this field,'); + $this->expectExceptionMessage('Please use only letters (a-z or A-Z), ' . + 'numbers (0-9) or underscore (_) in this field,'); $attributeData = $this->getAttributeData(); $this->eavSetup->addAttribute(\Magento\Catalog\Model\Product::ENTITY, $attributeCode, $attributeData);