Skip to content

Commit 83de1a1

Browse files
Igor Melnikovbuskamuza
authored andcommitted
MAGETWO-58692: Refactor Module_Webapi, Module_Elasticsearch
Introducing SerializerInterface
1 parent 1eb7a9c commit 83de1a1

File tree

2 files changed

+21
-53
lines changed

2 files changed

+21
-53
lines changed

app/code/Magento/Webapi/Test/Unit/_files/test_interfaces.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/code/Magento/Webapi/Test/Unit/Model/Soap/ConfigTest.php renamed to dev/tests/integration/testsuite/Magento/Webapi/Model/Soap/ConfigTest.php

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
<?php
22
/**
3-
* Config helper Unit tests.
4-
*
53
* Copyright © 2016 Magento. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
6+
namespace Magento\Webapi\Model\Soap;
87

98
// @codingStandardsIgnoreFile
109

11-
/**
12-
* Class implements tests for \Magento\Webapi\Model\Soap\Config class.
13-
*/
14-
namespace Magento\Webapi\Test\Unit\Model\Soap;
15-
1610
class ConfigTest extends \PHPUnit_Framework_TestCase
1711
{
18-
/** @var \Magento\Webapi\Model\Soap\Config */
19-
protected $_soapConfig;
12+
/**
13+
* @var \Magento\Webapi\Model\Soap\Config
14+
*/
15+
private $_soapConfig;
2016

21-
/** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */
22-
protected $objectManager;
17+
/**
18+
* @var \Magento\TestFramework\Helper\Bootstrap
19+
*/
20+
private $objectManager;
2321

2422
/**
2523
* Set up helper.
2624
*/
2725
protected function setUp()
2826
{
29-
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
27+
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
3028

31-
$typeProcessor = $this->objectManager->getObject(\Magento\Framework\Reflection\TypeProcessor::class);
29+
$typeProcessor = $this->objectManager->create(\Magento\Framework\Reflection\TypeProcessor::class);
3230

3331
$objectManagerMock = $this->getMockBuilder(
3432
\Magento\Framework\App\ObjectManager::class
@@ -97,21 +95,24 @@ protected function setUp()
9795
$config = new \Magento\Webapi\Model\Config($cacheMock, $readerMock);
9896

9997
/** @var $config \Magento\Webapi\Model\ServiceMetadata */
100-
$serviceMetadata = new \Magento\Webapi\Model\ServiceMetadata(
101-
$config,
102-
$cacheMock,
103-
$classReflection,
104-
$typeProcessor);
98+
$serviceMetadata = $this->objectManager->create(
99+
\Magento\Webapi\Model\ServiceMetadata::class,
100+
[
101+
'config' => $config,
102+
'cache' => $cacheMock,
103+
'classReflector' => $classReflection,
104+
'typeProcessor' => $typeProcessor
105+
]
106+
);
105107

106-
$this->_soapConfig = $this->objectManager->getObject(
108+
$this->_soapConfig = $this->objectManager->create(
107109
\Magento\Webapi\Model\Soap\Config::class,
108110
[
109111
'objectManager' => $objectManagerMock,
110112
'registry' => $registryMock,
111113
'serviceMetadata' => $serviceMetadata,
112114
]
113115
);
114-
parent::setUp();
115116
}
116117

117118
public function testGetRequestedSoapServices()
@@ -162,5 +163,3 @@ public function testGetSoapOperation()
162163
$this->assertEquals($expectedResult, $soapOperation);
163164
}
164165
}
165-
166-
require_once realpath(__DIR__ . '/../../_files/test_interfaces.php');

0 commit comments

Comments
 (0)