Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GroupListTest.php
Go to the documentation of this file.
1 <?php
8 
9 class GroupListTest extends \PHPUnit\Framework\TestCase
10 {
14  protected $groupArrayModel;
15 
19  protected $helperMock;
20 
21  protected function setUp()
22  {
23  $this->helperMock = $this->createMock(\Magento\Payment\Helper\Data::class);
24  $this->groupArrayModel = new \Magento\Payment\Model\ResourceModel\Grid\GroupList($this->helperMock);
25  }
26 
27  public function testToOptionArray()
28  {
29  $this->helperMock
30  ->expects($this->once())
31  ->method('getPaymentMethodList')
32  ->with(true, true, true)
33  ->will($this->returnValue(['group data']));
34  $this->assertEquals(['group data'], $this->groupArrayModel->toOptionArray());
35  }
36 }