Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigTest.php
Go to the documentation of this file.
1 <?php
7 
11 class ConfigTest extends \PHPUnit\Framework\TestCase
12 {
18  protected $helper;
19 
20  protected function setUp()
21  {
22  $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
23  $this->helper = $objectManagerHelper->getObject(\Magento\Ups\Helper\Config::class);
24  }
25 
32  public function testGetData($result, $type = null, $code = null)
33  {
34  $this->assertEquals($result, $this->helper->getCode($type, $code));
35  }
36 
42  public function getCodeDataProvider()
43  {
44  return [
45  [false],
46  [false, 'not-exist-type'],
47  [false, 'not-exist-type', 'not-exist-code'],
48  [false, 'action'],
49  [['single' => '3', 'all' => '4'], 'action', ''],
50  ['3', 'action', 'single']
51  ];
52  }
53 }
testGetData($result, $type=null, $code=null)
Definition: ConfigTest.php:32
$type
Definition: item.phtml:13
$code
Definition: info.phtml:12