From 02a809fd380f5588f7d01a0bf0a913af97ce9e37 Mon Sep 17 00:00:00 2001 From: Dmytro Kvashnin <dkvashnin@ebay.com> Date: Sun, 15 Mar 2015 16:55:23 +0200 Subject: [PATCH] MAGETWO-33083: Interception optimization - fixed merge conflicts --- .../Test/Unit/Environment/CompiledTest.php | 42 ----- .../Test/Unit/Environment/CompiledTesting.php | 30 ---- .../Test/Unit/Environment/ConfigTesting.php | 144 ------------------ .../Test/Unit/Environment/DeveloperTest.php | 32 ---- 4 files changed, 248 deletions(-) delete mode 100644 lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/CompiledTest.php delete mode 100644 lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/CompiledTesting.php delete mode 100644 lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/ConfigTesting.php delete mode 100644 lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/DeveloperTest.php diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/CompiledTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/CompiledTest.php deleted file mode 100644 index 43791391dae..00000000000 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/CompiledTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Framework\ObjectManager\Test\Unit\Environment; - -use \Magento\Framework\ObjectManager\Environment\Compiled; - -require 'CompiledTesting.php'; - -class CompiledTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Framework\ObjectManager\Environment\Compiled - */ - protected $_compiled; - - protected function setUp() - { - $envFactoryMock = $this->getMock('Magento\Framework\ObjectManager\EnvironmentFactory', [], [], '', false); - $this->_compiled = new \Magento\Framework\ObjectManager\Test\Unit\Environment\CompiledTesting($envFactoryMock); - } - - public function testGetFilePath() - { - $this->assertContains('/var/di/global.ser', $this->_compiled->getFilePath()); - } - - public function testGetMode() - { - $this->assertEquals(Compiled::MODE, $this->_compiled->getMode()); - } - - public function testGetObjectManagerFactory() - { - $this->assertInstanceOf( - 'Magento\Framework\ObjectManager\Factory\Compiled', - $this->_compiled->getObjectManagerFactory(['shared_instances' => []]) - ); - } -} diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/CompiledTesting.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/CompiledTesting.php deleted file mode 100644 index 82d199ebf3f..00000000000 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/CompiledTesting.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Framework\ObjectManager\Test\Unit\Environment; - -use Magento\Framework\ObjectManager\Environment\Compiled; - -require 'ConfigTesting.php'; - -class CompiledTesting extends Compiled -{ - /** - * @return array - */ - protected function getConfigData() - { - return []; - } - - /** - * @return \Magento\Framework\Interception\ObjectManager\ConfigInterface - */ - public function getDiConfig() - { - return new ConfigTesting(); - } -} diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/ConfigTesting.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/ConfigTesting.php deleted file mode 100644 index 8ba5771121b..00000000000 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/ConfigTesting.php +++ /dev/null @@ -1,144 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Framework\ObjectManager\Test\Unit\Environment; - -use Magento\Framework\Interception\ObjectManager\ConfigInterface; -use Magento\Framework\ObjectManager\ConfigCacheInterface; -use Magento\Framework\ObjectManager\RelationsInterface; - -class ConfigTesting implements ConfigInterface -{ - - /** - * Set class relations - * - * @param RelationsInterface $relations - * - * @return void - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function setRelations(RelationsInterface $relations) - { - return; - } - - /** - * Set configuration cache instance - * - * @param ConfigCacheInterface $cache - * - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function setCache(ConfigCacheInterface $cache) - { - return; - } - - /** - * Retrieve list of arguments per type - * - * @param string $type - * @return array - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getArguments($type) - { - return []; - } - - /** - * Check whether type is shared - * - * @param string $type - * @return bool - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function isShared($type) - { - return true; - } - - /** - * Retrieve instance type - * - * @param string $instanceName - * @return mixed - */ - public function getInstanceType($instanceName) - { - return $instanceName; - } - - /** - * Retrieve preference for type - * - * @param string $type - * @return string - * @throws \LogicException - */ - public function getPreference($type) - { - return $type; - } - - /** - * Returns list of virtual types - * - * @return array - */ - public function getVirtualTypes() - { - return []; - } - - /** - * Extend configuration - * - * @param array $configuration - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function extend(array $configuration) - { - return; - } - - /** - * Returns list on preferences - * - * @return array - */ - public function getPreferences() - { - return []; - } - - /** - * Set Interception config - * - * @param \Magento\Framework\Interception\ConfigInterface $interceptionConfig - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function setInterceptionConfig(\Magento\Framework\Interception\ConfigInterface $interceptionConfig) - { - return; - } - - /** - * Retrieve instance type without interception processing - * - * @param string $instanceName - * @return string - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getOriginalInstanceType($instanceName) - { - return ''; - } -} diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/DeveloperTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/DeveloperTest.php deleted file mode 100644 index 1813ee33cf7..00000000000 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Environment/DeveloperTest.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Framework\ObjectManager\Test\Unit\Environment; - -use \Magento\Framework\ObjectManager\Environment\Developer; - -class DeveloperTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Framework\ObjectManager\Environment\Developer - */ - protected $_developer; - - protected function setUp() - { - $envFactoryMock = $this->getMock('Magento\Framework\ObjectManager\EnvironmentFactory', [], [], '', false); - $this->_developer = new \Magento\Framework\ObjectManager\Environment\Developer($envFactoryMock); - } - - public function testGetMode() - { - $this->assertEquals(Developer::MODE, $this->_developer->getMode()); - } - - public function testGetObjectManagerConfigLoader() - { - $this->assertNull($this->_developer->getObjectManagerConfigLoader()); - } -} -- GitLab