From 83de1a1982d465b8af4d9b27e0a3df9e0d42f0c4 Mon Sep 17 00:00:00 2001 From: Igor Melnikov <imelnikov@magento.com> Date: Mon, 24 Oct 2016 19:23:39 -0500 Subject: [PATCH] MAGETWO-58692: Refactor Module_Webapi, Module_Elasticsearch Introducing SerializerInterface --- .../Test/Unit/_files/test_interfaces.php | 31 ------------- .../Magento/Webapi}/Model/Soap/ConfigTest.php | 43 +++++++++---------- 2 files changed, 21 insertions(+), 53 deletions(-) delete mode 100644 app/code/Magento/Webapi/Test/Unit/_files/test_interfaces.php rename {app/code/Magento/Webapi/Test/Unit => dev/tests/integration/testsuite/Magento/Webapi}/Model/Soap/ConfigTest.php (84%) diff --git a/app/code/Magento/Webapi/Test/Unit/_files/test_interfaces.php b/app/code/Magento/Webapi/Test/Unit/_files/test_interfaces.php deleted file mode 100644 index 288a747cefd..00000000000 --- a/app/code/Magento/Webapi/Test/Unit/_files/test_interfaces.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * Copyright © 2016 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -// @codingStandardsIgnoreFile - -namespace Magento\Framework\Module\Service; - -/** - * The list of test interfaces. - */ -interface FooV1Interface -{ - public function someMethod(); -} -interface BarV1Interface -{ - public function someMethod(); -} -interface FooBarV1Interface -{ - public function someMethod(); -} -namespace Magento\Framework\Module\Service\Foo; - -interface BarV1Interface -{ - public function someMethod(); -} diff --git a/app/code/Magento/Webapi/Test/Unit/Model/Soap/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Model/Soap/ConfigTest.php similarity index 84% rename from app/code/Magento/Webapi/Test/Unit/Model/Soap/ConfigTest.php rename to dev/tests/integration/testsuite/Magento/Webapi/Model/Soap/ConfigTest.php index aa5d1a7bfab..74e6728fcee 100644 --- a/app/code/Magento/Webapi/Test/Unit/Model/Soap/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Soap/ConfigTest.php @@ -1,34 +1,32 @@ <?php /** - * Config helper Unit tests. - * * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ +namespace Magento\Webapi\Model\Soap; // @codingStandardsIgnoreFile -/** - * Class implements tests for \Magento\Webapi\Model\Soap\Config class. - */ -namespace Magento\Webapi\Test\Unit\Model\Soap; - class ConfigTest extends \PHPUnit_Framework_TestCase { - /** @var \Magento\Webapi\Model\Soap\Config */ - protected $_soapConfig; + /** + * @var \Magento\Webapi\Model\Soap\Config + */ + private $_soapConfig; - /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ - protected $objectManager; + /** + * @var \Magento\TestFramework\Helper\Bootstrap + */ + private $objectManager; /** * Set up helper. */ protected function setUp() { - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $typeProcessor = $this->objectManager->getObject(\Magento\Framework\Reflection\TypeProcessor::class); + $typeProcessor = $this->objectManager->create(\Magento\Framework\Reflection\TypeProcessor::class); $objectManagerMock = $this->getMockBuilder( \Magento\Framework\App\ObjectManager::class @@ -97,13 +95,17 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $config = new \Magento\Webapi\Model\Config($cacheMock, $readerMock); /** @var $config \Magento\Webapi\Model\ServiceMetadata */ - $serviceMetadata = new \Magento\Webapi\Model\ServiceMetadata( - $config, - $cacheMock, - $classReflection, - $typeProcessor); + $serviceMetadata = $this->objectManager->create( + \Magento\Webapi\Model\ServiceMetadata::class, + [ + 'config' => $config, + 'cache' => $cacheMock, + 'classReflector' => $classReflection, + 'typeProcessor' => $typeProcessor + ] + ); - $this->_soapConfig = $this->objectManager->getObject( + $this->_soapConfig = $this->objectManager->create( \Magento\Webapi\Model\Soap\Config::class, [ 'objectManager' => $objectManagerMock, @@ -111,7 +113,6 @@ class ConfigTest extends \PHPUnit_Framework_TestCase 'serviceMetadata' => $serviceMetadata, ] ); - parent::setUp(); } public function testGetRequestedSoapServices() @@ -162,5 +163,3 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expectedResult, $soapOperation); } } - -require_once realpath(__DIR__ . '/../../_files/test_interfaces.php'); -- GitLab