|
1 | 1 | <?php
|
2 | 2 | /**
|
3 |
| - * Config helper Unit tests. |
4 |
| - * |
5 | 3 | * Copyright © 2016 Magento. All rights reserved.
|
6 | 4 | * See COPYING.txt for license details.
|
7 | 5 | */
|
| 6 | +namespace Magento\Webapi\Model\Soap; |
8 | 7 |
|
9 | 8 | // @codingStandardsIgnoreFile
|
10 | 9 |
|
11 |
| -/** |
12 |
| - * Class implements tests for \Magento\Webapi\Model\Soap\Config class. |
13 |
| - */ |
14 |
| -namespace Magento\Webapi\Test\Unit\Model\Soap; |
15 |
| - |
16 | 10 | class ConfigTest extends \PHPUnit_Framework_TestCase
|
17 | 11 | {
|
18 |
| - /** @var \Magento\Webapi\Model\Soap\Config */ |
19 |
| - protected $_soapConfig; |
| 12 | + /** |
| 13 | + * @var \Magento\Webapi\Model\Soap\Config |
| 14 | + */ |
| 15 | + private $_soapConfig; |
20 | 16 |
|
21 |
| - /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ |
22 |
| - protected $objectManager; |
| 17 | + /** |
| 18 | + * @var \Magento\TestFramework\Helper\Bootstrap |
| 19 | + */ |
| 20 | + private $objectManager; |
23 | 21 |
|
24 | 22 | /**
|
25 | 23 | * Set up helper.
|
26 | 24 | */
|
27 | 25 | protected function setUp()
|
28 | 26 | {
|
29 |
| - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); |
| 27 | + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); |
30 | 28 |
|
31 |
| - $typeProcessor = $this->objectManager->getObject(\Magento\Framework\Reflection\TypeProcessor::class); |
| 29 | + $typeProcessor = $this->objectManager->create(\Magento\Framework\Reflection\TypeProcessor::class); |
32 | 30 |
|
33 | 31 | $objectManagerMock = $this->getMockBuilder(
|
34 | 32 | \Magento\Framework\App\ObjectManager::class
|
@@ -97,21 +95,24 @@ protected function setUp()
|
97 | 95 | $config = new \Magento\Webapi\Model\Config($cacheMock, $readerMock);
|
98 | 96 |
|
99 | 97 | /** @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 | + ); |
105 | 107 |
|
106 |
| - $this->_soapConfig = $this->objectManager->getObject( |
| 108 | + $this->_soapConfig = $this->objectManager->create( |
107 | 109 | \Magento\Webapi\Model\Soap\Config::class,
|
108 | 110 | [
|
109 | 111 | 'objectManager' => $objectManagerMock,
|
110 | 112 | 'registry' => $registryMock,
|
111 | 113 | 'serviceMetadata' => $serviceMetadata,
|
112 | 114 | ]
|
113 | 115 | );
|
114 |
| - parent::setUp(); |
115 | 116 | }
|
116 | 117 |
|
117 | 118 | public function testGetRequestedSoapServices()
|
@@ -162,5 +163,3 @@ public function testGetSoapOperation()
|
162 | 163 | $this->assertEquals($expectedResult, $soapOperation);
|
163 | 164 | }
|
164 | 165 | }
|
165 |
| - |
166 |
| -require_once realpath(__DIR__ . '/../../_files/test_interfaces.php'); |
0 commit comments