/**
  * @param bool $isAvailable
  * @param string $mailingAddress
  * @param string $payableTo
  * @param array $result
  * @dataProvider dataProviderGetConfig
  */
 public function testGetConfig($isAvailable, $mailingAddress, $payableTo, $result)
 {
     $this->methodMock->expects($this->once())->method('isAvailable')->willReturn($isAvailable);
     $this->methodMock->expects($this->any())->method('getMailingAddress')->willReturn($mailingAddress);
     $this->methodMock->expects($this->any())->method('getPayableTo')->willReturn($payableTo);
     $this->assertEquals($result, $this->model->getConfig());
 }
Example #2
0
 public function testAssignData()
 {
     $details['payable_to'] = 'payable';
     $details['mailing_address'] = '*****@*****.**';
     $this->_object->setStore(1);
     $this->_scopeConfig->expects($this->any())->method('getValue')->willReturnMap([['payment/checkmo/payable_to', 'store', 1, 'payable'], ['payment/checkmo/mailing_address', 'store', 1, '*****@*****.**']]);
     $instance = $this->getMock('Magento\\Payment\\Model\\Info', ['setAdditionalData'], [], '', false);
     $instance->expects($this->once())->method('setAdditionalData')->with(serialize($details));
     $this->_object->setData('info_instance', $instance);
     $this->_object->assignData('');
 }
 /**
  * Get payable to from config
  *
  * @return string
  */
 protected function getPayableTo()
 {
     return $this->method->getPayableTo();
 }
 public function testGetMailingAddress()
 {
     $this->_object->setStore(1);
     $this->_scopeConfig->expects($this->once())->method('getValue')->with('payment/checkmo/mailing_address', 'store', 1)->willReturn('*****@*****.**');
     $this->assertEquals('*****@*****.**', $this->_object->getMailingAddress());
 }