From 31d3c5622d6fbba424a7cf3fcf84cf6fcb4a9675 Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Mon, 17 Oct 2016 16:02:27 -0500 Subject: [PATCH] MAGETWO-58446: Remove uses of unserialize in usages of \Magento\Framework\Cache\FrontendInterface::load() - Merge upstream/develop resolve conflict --- .../Test/Unit/PluginList/PluginListTest.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/PluginList/PluginListTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/PluginList/PluginListTest.php index f1dc8aee39e..b32a14547ee 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/PluginList/PluginListTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/PluginList/PluginListTest.php @@ -40,10 +40,8 @@ class PluginListTest extends \PHPUnit_Framework_TestCase /** @var JsonInterface|\PHPUnit_Framework_MockObject_MockObject */ private $jsonMock; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $objectManagerMock; + /** @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ + private $loggerMock; protected function setUp() { @@ -64,8 +62,8 @@ class PluginListTest extends \PHPUnit_Framework_TestCase $omConfigMock->expects($this->any())->method('getOriginalInstanceType')->will($this->returnArgument(0)); - $this->objectManagerMock = $this->getMock(\Magento\Framework\ObjectManagerInterface::class); - $this->objectManagerMock->expects($this->any())->method('get')->will($this->returnArgument(0)); + $objectManagerMock = $this->getMock(\Magento\Framework\ObjectManagerInterface::class); + $objectManagerMock->expects($this->any())->method('get')->will($this->returnArgument(0)); $definitions = new \Magento\Framework\ObjectManager\Definition\Runtime(); @@ -79,7 +77,7 @@ class PluginListTest extends \PHPUnit_Framework_TestCase 'relations' => new \Magento\Framework\ObjectManager\Relations\Runtime(), 'omConfig' => $omConfigMock, 'definitions' => new \Magento\Framework\Interception\Definition\Runtime(), - 'objectManager' => $this->objectManagerMock, + 'objectManager' => $objectManagerMock, 'classDefinitions' => $definitions, 'scopePriorityScheme' => ['global'], 'cacheId' => 'interception' @@ -91,6 +89,13 @@ class PluginListTest extends \PHPUnit_Framework_TestCase 'json', $this->jsonMock ); + + $this->loggerMock = $this->getMock(\Psr\Log\LoggerInterface::class); + $objectManagerHelper->setBackwardCompatibleProperty( + $this->object, + 'logger', + $this->loggerMock + ); } public function testGetPlugin() @@ -253,12 +258,7 @@ class PluginListTest extends \PHPUnit_Framework_TestCase */ public function testInheritPluginsWithNotExistingPlugin() { - $loggerMock = $this->getMock(\Psr\Log\LoggerInterface::class); - $this->objectManagerMock->expects($this->once()) - ->method('get') - ->with(\Psr\Log\LoggerInterface::class) - ->willReturn($loggerMock); - $loggerMock->expects($this->once()) + $this->loggerMock->expects($this->once()) ->method('info') ->with("Reference to undeclared plugin with name 'simple_plugin'."); $this->configScopeMock->expects($this->any()) -- GitLab