Skip to content
Snippets Groups Projects
Commit 31d3c562 authored by Joan He's avatar Joan He
Browse files

MAGETWO-58446: Remove uses of unserialize in usages of...

MAGETWO-58446: Remove uses of unserialize in usages of \Magento\Framework\Cache\FrontendInterface::load()

- Merge upstream/develop resolve conflict
parent f22a2ffb
No related merge requests found
...@@ -40,10 +40,8 @@ class PluginListTest extends \PHPUnit_Framework_TestCase ...@@ -40,10 +40,8 @@ class PluginListTest extends \PHPUnit_Framework_TestCase
/** @var JsonInterface|\PHPUnit_Framework_MockObject_MockObject */ /** @var JsonInterface|\PHPUnit_Framework_MockObject_MockObject */
private $jsonMock; private $jsonMock;
/** /** @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */
* @var \PHPUnit_Framework_MockObject_MockObject private $loggerMock;
*/
protected $objectManagerMock;
protected function setUp() protected function setUp()
{ {
...@@ -64,8 +62,8 @@ class PluginListTest extends \PHPUnit_Framework_TestCase ...@@ -64,8 +62,8 @@ class PluginListTest extends \PHPUnit_Framework_TestCase
$omConfigMock->expects($this->any())->method('getOriginalInstanceType')->will($this->returnArgument(0)); $omConfigMock->expects($this->any())->method('getOriginalInstanceType')->will($this->returnArgument(0));
$this->objectManagerMock = $this->getMock(\Magento\Framework\ObjectManagerInterface::class); $objectManagerMock = $this->getMock(\Magento\Framework\ObjectManagerInterface::class);
$this->objectManagerMock->expects($this->any())->method('get')->will($this->returnArgument(0)); $objectManagerMock->expects($this->any())->method('get')->will($this->returnArgument(0));
$definitions = new \Magento\Framework\ObjectManager\Definition\Runtime(); $definitions = new \Magento\Framework\ObjectManager\Definition\Runtime();
...@@ -79,7 +77,7 @@ class PluginListTest extends \PHPUnit_Framework_TestCase ...@@ -79,7 +77,7 @@ class PluginListTest extends \PHPUnit_Framework_TestCase
'relations' => new \Magento\Framework\ObjectManager\Relations\Runtime(), 'relations' => new \Magento\Framework\ObjectManager\Relations\Runtime(),
'omConfig' => $omConfigMock, 'omConfig' => $omConfigMock,
'definitions' => new \Magento\Framework\Interception\Definition\Runtime(), 'definitions' => new \Magento\Framework\Interception\Definition\Runtime(),
'objectManager' => $this->objectManagerMock, 'objectManager' => $objectManagerMock,
'classDefinitions' => $definitions, 'classDefinitions' => $definitions,
'scopePriorityScheme' => ['global'], 'scopePriorityScheme' => ['global'],
'cacheId' => 'interception' 'cacheId' => 'interception'
...@@ -91,6 +89,13 @@ class PluginListTest extends \PHPUnit_Framework_TestCase ...@@ -91,6 +89,13 @@ class PluginListTest extends \PHPUnit_Framework_TestCase
'json', 'json',
$this->jsonMock $this->jsonMock
); );
$this->loggerMock = $this->getMock(\Psr\Log\LoggerInterface::class);
$objectManagerHelper->setBackwardCompatibleProperty(
$this->object,
'logger',
$this->loggerMock
);
} }
public function testGetPlugin() public function testGetPlugin()
...@@ -253,12 +258,7 @@ class PluginListTest extends \PHPUnit_Framework_TestCase ...@@ -253,12 +258,7 @@ class PluginListTest extends \PHPUnit_Framework_TestCase
*/ */
public function testInheritPluginsWithNotExistingPlugin() public function testInheritPluginsWithNotExistingPlugin()
{ {
$loggerMock = $this->getMock(\Psr\Log\LoggerInterface::class); $this->loggerMock->expects($this->once())
$this->objectManagerMock->expects($this->once())
->method('get')
->with(\Psr\Log\LoggerInterface::class)
->willReturn($loggerMock);
$loggerMock->expects($this->once())
->method('info') ->method('info')
->with("Reference to undeclared plugin with name 'simple_plugin'."); ->with("Reference to undeclared plugin with name 'simple_plugin'.");
$this->configScopeMock->expects($this->any()) $this->configScopeMock->expects($this->any())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment