![]() 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-payment/Test/Unit/Block/Transparent/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Payment\Test\Unit\Block\Transparent; use Magento\Payment\Block\Transparent\Redirect; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\MockObject\MockObject; class RedirectTest extends TestCase { /** * @var \Magento\Framework\View\Element\Context|MockObject */ private $context; /** * @var \Magento\Framework\UrlInterface|MockObject */ private $url; /** * @var Redirect */ private $model; /** * @var \Magento\Framework\App\RequestInterface|MockObject */ private $request; /** * @inheritDoc */ protected function setUp(): void { parent::setUp(); $this->context = $this->createMock(\Magento\Framework\View\Element\Template\Context::class); $this->request = $this->createMock(\Magento\Framework\App\Request\Http::class); $this->context->method('getRequest') ->willReturn($this->request); $this->url = $this->createMock(\Magento\Framework\UrlInterface::class); $this->model = new Redirect( $this->context, $this->url ); } /** * @param array $postData * @param array $expected * @dataProvider getPostParamsDataProvider */ public function testGetPostParams(array $postData, array $expected): void { $this->request->method('getPostValue') ->willReturn($postData); $this->assertEquals($expected, $this->model->getPostParams()); } /** * @return array */ public function getPostParamsDataProvider(): array { return [ [ [ 'BILLTOEMAIL' => '[email protected]', 'BILLTOSTREET' => '3640 Holdrege Ave', 'BILLTOZIP' => '90016', 'BILLTOLASTNAME' => 'Ãtienne', 'BILLTOFIRSTNAME' => 'Ãillin', ], [ 'BILLTOEMAIL' => '[email protected]', 'BILLTOSTREET' => '3640 Holdrege Ave', 'BILLTOZIP' => '90016', 'BILLTOLASTNAME' => 'Ãtienne', 'BILLTOFIRSTNAME' => 'Ãillin', ] ], [ [ 'BILLTOEMAIL' => '[email protected]', 'BILLTOSTREET' => '3640 Holdrege Ave', 'BILLTOZIP' => '90016', 'BILLTOLASTNAME' => mb_convert_encoding('Ãtienne', 'ISO-8859-1'), 'BILLTOFIRSTNAME' => mb_convert_encoding('Ãillin', 'ISO-8859-1'), ], [ 'BILLTOEMAIL' => '[email protected]', 'BILLTOSTREET' => '3640 Holdrege Ave', 'BILLTOZIP' => '90016', 'BILLTOLASTNAME' => 'Ãtienne', 'BILLTOFIRSTNAME' => 'Ãillin', ] ] ]; } }