Skip to content
Snippets Groups Projects
Commit 70b8bfcd authored by Yaroslav Onischenko's avatar Yaroslav Onischenko
Browse files

MAGETWO-55908: Prepare PR

parent 7fb9c0b5
No related merge requests found
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Customer\Model\Config\Source\Group;
use Magento\TestFramework\Helper\Bootstrap;
/**
* Class \Magento\Customer\Model\Config\Source\Group\Multiselect
*/
class MultiselectTest extends \PHPUnit_Framework_TestCase
{
public function testToOptionArray()
{
/** @var Multiselect $multiselect */
$multiselect = Bootstrap::getObjectManager()->get(
\Magento\Customer\Model\Config\Source\Group\Multiselect::class
);
$options = $multiselect->toOptionArray();
$optionsToCompare = [];
foreach ($options as $option) {
if (is_array($option['value'])) {
$optionsToCompare = array_merge($optionsToCompare, $option['value']);
} else {
$optionsToCompare[] = $option;
}
}
sort($optionsToCompare);
$this->assertEquals(
[
['value' => 1, 'label' => 'General'],
['value' => 2, 'label' => 'Wholesale'],
['value' => 3, 'label' => 'Retailer'],
],
$optionsToCompare
);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment