Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DataTest.php
Go to the documentation of this file.
1 <?php
7 
9 
10 class DataTest extends \PHPUnit\Framework\TestCase
11 {
13  protected $dataHelper;
14 
15  protected function setUp()
16  {
17  $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
18  $this->dataHelper = $helper->getObject(\Magento\Integration\Helper\Data::class);
19  }
20 
21  public function testMapResources()
22  {
23  $testData = require __DIR__ . '/_files/acl.php';
24  $expectedData = require __DIR__ . '/_files/acl-map.php';
25  $this->assertEquals($expectedData, $this->dataHelper->mapResources($testData));
26  }
27 
31  public function testIsConfigType($integrationsData, $expectedResult)
32  {
33  $this->assertEquals($expectedResult, $this->dataHelper->isConfigType($integrationsData));
34  }
35 
39  public function integrationDataProvider()
40  {
41  return [
42  [
43  [
44  'id' => 1,
45  Integration::NAME => 'TestIntegration1',
47  Integration::ENDPOINT => 'http://endpoint.com',
49  ],
50  true,
51  ],
52  [
53  [
54  'id' => 1,
55  Integration::NAME => 'TestIntegration1',
57  Integration::ENDPOINT => 'http://endpoint.com',
59  ],
60  false,
61  ]
62  ];
63  }
64 }
$helper
Definition: iframe.phtml:13
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60
testIsConfigType($integrationsData, $expectedResult)
Definition: DataTest.php:31