Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
WebsitesOptionsProviderTest.php
Go to the documentation of this file.
1 <?php
7 
8 class WebsitesOptionsProviderTest extends \PHPUnit\Framework\TestCase
9 {
13  private $model;
14 
18  private $storeMock;
19 
20  protected function setup()
21  {
22  $this->storeMock = $this->createMock(\Magento\Store\Model\System\Store::class);
23  $this->model = new \Magento\CatalogRule\Model\Rule\WebsitesOptionsProvider($this->storeMock);
24  }
25 
26  public function testToOptionArray()
27  {
28  $options = [
29  ['label' => 'label', 'value' => 'value']
30  ];
31  $this->storeMock->expects($this->once())->method('getWebsiteValuesForForm')->willReturn($options);
32  $this->assertEquals($options, $this->model->toOptionArray());
33  }
34 }