Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
VerticalTest.php
Go to the documentation of this file.
1 <?php
7 
11 class VerticalTest extends \PHPUnit\Framework\TestCase
12 {
16  private $subject;
17 
21  private $objectManagerHelper;
22 
26  protected function setUp()
27  {
28  $this->objectManagerHelper =
29  new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
30 
31  $this->subject = $this->objectManagerHelper->getObject(
32  \Magento\Analytics\Model\Config\Source\Vertical::class,
33  [
34  'verticals' => [
35  'Apps and Games',
36  'Athletic/Sporting Goods',
37  'Art and Design'
38  ]
39  ]
40  );
41  }
42 
46  public function testToOptionArray()
47  {
48  $expectedOptionsArray = [
49  ['value' => '', 'label' => __('--Please Select--')],
50  ['value' => 'Apps and Games', 'label' => __('Apps and Games')],
51  ['value' => 'Athletic/Sporting Goods', 'label' => __('Athletic/Sporting Goods')],
52  ['value' => 'Art and Design', 'label' => __('Art and Design')]
53  ];
54 
55  $this->assertEquals(
56  $expectedOptionsArray,
57  $this->subject->toOptionArray()
58  );
59  }
60 }
__()
Definition: __.php:13