Skip to content

Commit 70b8bfc

Browse files
author
Yaroslav Onischenko
committed
MAGETWO-55908: Prepare PR
1 parent 7fb9c0b commit 70b8bfc

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Customer\Model\Config\Source\Group;
7+
8+
use Magento\TestFramework\Helper\Bootstrap;
9+
10+
/**
11+
* Class \Magento\Customer\Model\Config\Source\Group\Multiselect
12+
*/
13+
class MultiselectTest extends \PHPUnit_Framework_TestCase
14+
{
15+
public function testToOptionArray()
16+
{
17+
/** @var Multiselect $multiselect */
18+
$multiselect = Bootstrap::getObjectManager()->get(
19+
\Magento\Customer\Model\Config\Source\Group\Multiselect::class
20+
);
21+
22+
$options = $multiselect->toOptionArray();
23+
$optionsToCompare = [];
24+
foreach ($options as $option) {
25+
if (is_array($option['value'])) {
26+
$optionsToCompare = array_merge($optionsToCompare, $option['value']);
27+
} else {
28+
$optionsToCompare[] = $option;
29+
}
30+
}
31+
sort($optionsToCompare);
32+
$this->assertEquals(
33+
[
34+
['value' => 1, 'label' => 'General'],
35+
['value' => 2, 'label' => 'Wholesale'],
36+
['value' => 3, 'label' => 'Retailer'],
37+
],
38+
$optionsToCompare
39+
);
40+
}
41+
}

0 commit comments

Comments
 (0)