Skip to content
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