Definition at line 11 of file ViewTest.php.
◆ setUp()
Definition at line 19 of file ViewTest.php.
21 $this->_customerMetadataService = $this->createMock(\
Magento\Customer\Api\CustomerMetadataInterface::class);
23 \
Magento\Customer\Helper\View::class,
24 [
'customerMetadataService' => $this->_customerMetadataService]
static getObjectManager()
◆ testGetCustomerName()
testGetCustomerName |
( |
|
$customerData, |
|
|
|
$expectedCustomerName, |
|
|
|
$isPrefixAllowed = false , |
|
|
|
$isMiddleNameAllowed = false , |
|
|
|
$isSuffixAllowed = false |
|
) |
| |
- Parameters
-
\Magento\Customer\Api\Data\CustomerInterface | $customerData | |
string | $expectedCustomerName | |
bool | $isPrefixAllowed | |
bool | $isMiddleNameAllowed | |
bool | $isSuffixAllowed | @dataProvider getCustomerNameDataProvider |
Definition at line 37 of file ViewTest.php.
44 $visibleAttribute = $this->createMock(\
Magento\Customer\Api\Data\AttributeMetadataInterface::class);
45 $visibleAttribute->expects($this->any())->method(
'isVisible')->will($this->returnValue(
true));
47 $invisibleAttribute = $this->createMock(\
Magento\Customer\Api\Data\AttributeMetadataInterface::class);
48 $invisibleAttribute->expects($this->any())->method(
'isVisible')->will($this->returnValue(
false));
50 $this->_customerMetadataService->expects(
53 'getAttributeMetadata' 55 $this->returnValueMap(
57 [
'prefix', $isPrefixAllowed ? $visibleAttribute : $invisibleAttribute],
58 [
'middlename', $isMiddleNameAllowed ? $visibleAttribute : $invisibleAttribute],
59 [
'suffix', $isSuffixAllowed ? $visibleAttribute : $invisibleAttribute],
65 $expectedCustomerName,
67 'Full customer name is invalid'
◆ $_customerMetadataService
$_customerMetadataService |
|
protected |
◆ $_helper
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Customer/Helper/ViewTest.php