Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AllmethodsTest.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Payment\Model\Config\Source\Allmethods;
10 
11 class AllmethodsTest extends \PHPUnit\Framework\TestCase
12 {
18  protected $_paymentData;
19 
23  protected $_model;
24 
25  protected function setUp()
26  {
27  $this->_paymentData = $this->getMockBuilder(
28  \Magento\Payment\Helper\Data::class
29  )->disableOriginalConstructor()->setMethods([])->getMock();
30 
31  $this->_model = new Allmethods($this->_paymentData);
32  }
33 
34  public function testToOptionArray()
35  {
36  $expectedArray = ['key' => 'value'];
37  $this->_paymentData->expects($this->once())
38  ->method('getPaymentMethodList')
39  ->with(true, true, true)
40  ->will($this->returnValue($expectedArray));
41  $this->assertEquals($expectedArray, $this->_model->toOptionArray());
42  }
43 }