![]() 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-ups/Test/Unit/Helper/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Ups\Test\Unit\Helper; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Ups\Helper\Config; use PHPUnit\Framework\TestCase; /** * Config helper Test */ class ConfigTest extends TestCase { /** * Ups config helper * * @var Config */ protected $helper; protected function setUp(): void { $objectManagerHelper = new ObjectManager($this); $this->helper = $objectManagerHelper->getObject(Config::class); } /** * @param mixed $result * @param null|string $type * @param string $code * @dataProvider getCodeDataProvider */ public function testGetData($result, $type = null, $code = null) { $this->assertEquals($result, $this->helper->getCode($type, $code)); } /** * Data provider * * @return array */ public function getCodeDataProvider() { return [ [false], [false, 'not-exist-type'], [false, 'not-exist-type', 'not-exist-code'], [false, 'action'], [['single' => '3', 'all' => '4'], 'action', ''], ['3', 'action', 'single'] ]; } }