File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
dev/tests/integration/testsuite/Magento/Customer/Model/Config/Source/Group Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments