Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-eav
Test
Unit
Model
Entity
Attribute
Backend
ArrayBackendTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Eav\Test\Unit\Model\Entity\Attribute\Backend
;
7
8
class
ArrayBackendTest
extends
\PHPUnit\Framework\TestCase
9
{
13
protected
$_model
;
14
18
protected
$_attribute
;
19
20
protected
function
setUp
()
21
{
22
$this->_attribute = $this->createPartialMock(
23
\
Magento
\Eav\Model\Entity\Attribute::class,
24
[
'getAttributeCode'
,
'__wakeup'
]
25
);
26
$logger
= $this->createMock(\Psr\Log\LoggerInterface::class);
27
$this->_model = new \Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend(
$logger
);
28
$this->_model->setAttribute($this->_attribute);
29
}
30
34
public
function
testValidate
(
$data
)
35
{
36
$this->_attribute->expects($this->atLeastOnce())->method(
'getAttributeCode'
)->will($this->returnValue(
'code'
));
37
$product
= new \Magento\Framework\DataObject([
'code'
=>
$data
,
'empty'
=>
''
]);
38
$this->_model->validate(
$product
);
39
$this->assertEquals(
'1,2,3'
,
$product
->getCode());
40
$this->assertEquals(
null
,
$product
->getEmpty());
41
}
42
46
public
static
function
attributeValueDataProvider
()
47
{
48
return
[[[1, 2, 3]], [
'1,2,3'
]];
49
}
50
}
Magento\Eav\Test\Unit\Model\Entity\Attribute\Backend
Definition:
AbstractTest.php:6
$logger
$logger
Definition:
health_check.php:20
Magento\Eav\Test\Unit\Model\Entity\Attribute\Backend\ArrayBackendTest\$_attribute
$_attribute
Definition:
ArrayBackendTest.php:18
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Eav\Test\Unit\Model\Entity\Attribute\Backend\ArrayBackendTest\attributeValueDataProvider
static attributeValueDataProvider()
Definition:
ArrayBackendTest.php:46
Magento
Magento\Eav\Test\Unit\Model\Entity\Attribute\Backend\ArrayBackendTest\testValidate
testValidate($data)
Definition:
ArrayBackendTest.php:34
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\Eav\Test\Unit\Model\Entity\Attribute\Backend\ArrayBackendTest\setUp
setUp()
Definition:
ArrayBackendTest.php:20
Magento\Eav\Test\Unit\Model\Entity\Attribute\Backend\ArrayBackendTest\$_model
$_model
Definition:
ArrayBackendTest.php:13
Magento\Eav\Test\Unit\Model\Entity\Attribute\Backend\ArrayBackendTest
Definition:
ArrayBackendTest.php:8