![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-paypal/Test/Unit/Block/PayflowExpress/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Paypal\Test\Unit\Block\PayflowExpress; use Magento\Framework\Locale\ResolverInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\View\Element\Template; use Magento\Framework\View\LayoutInterface; use Magento\Paypal\Block\PayflowExpress\Form; use Magento\Paypal\Model\Config; use Magento\Paypal\Model\ConfigFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class FormTest extends TestCase { /** * @var Config|MockObject */ protected $_paypalConfig; /** * @var Form */ protected $_model; protected function setUp(): void { $this->_paypalConfig = $this->createMock(Config::class); $this->_paypalConfig ->expects($this->once()) ->method('setMethod')->willReturnSelf(); $paypalConfigFactory = $this->createPartialMock(ConfigFactory::class, ['create']); $paypalConfigFactory->expects($this->once()) ->method('create') ->willReturn($this->_paypalConfig); $mark = $this->createMock(Template::class); $mark->expects($this->once()) ->method('setTemplate')->willReturnSelf(); $mark->expects($this->any()) ->method('__call')->willReturnSelf(); $layout = $this->getMockForAbstractClass( LayoutInterface::class ); $layout->expects($this->once()) ->method('createBlock') ->with(Template::class) ->willReturn($mark); $localeResolver = $this->getMockForAbstractClass(ResolverInterface::class); $helper = new ObjectManager($this); $this->_model = $helper->getObject( Form::class, [ 'paypalConfigFactory' => $paypalConfigFactory, 'layout' => $layout, 'localeResolver' => $localeResolver ] ); } public function testGetBillingAgreementCode() { $this->assertFalse($this->_model->getBillingAgreementCode()); } }