Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added app isolation attribute to tests in EavSetupTest #39617

Open
wants to merge 2 commits into
base: 2.4-develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2025 Adobe
* All Rights Reserved.
*/

namespace Magento\Eav\Setup;

use Magento\TestFramework\Fixture\AppIsolation;

/**
* Test class for Magento\Eav\Setup\EavSetup.
* @magentoDbIsolation enabled
*/
class EavSetupTest extends \PHPUnit\Framework\TestCase
{
/**
* Eav setup.
*
* @var \Magento\Eav\Setup\EavSetup
*/
private $eavSetup;
Expand Down Expand Up @@ -66,6 +65,7 @@ public static function addAttributeDataProvider()
*
* @dataProvider addAttributeThrowExceptionDataProvider
*/
#[AppIsolation(true)]
public function testAddAttributeThrowException($attributeCode)
{
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
Expand Down Expand Up @@ -98,10 +98,12 @@ public static function addAttributeThrowExceptionDataProvider()
*
* @dataProvider addInvalidAttributeThrowExceptionDataProvider
*/
#[AppIsolation(true)]
public function testAddInvalidAttributeThrowException($attributeCode)
{
$this->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);
Expand Down