From 7b3b49e56362d37d4d9ca0a55faf739f67c6a423 Mon Sep 17 00:00:00 2001 From: Akolzin Dmitry Date: Thu, 21 Mar 2019 10:37:20 +0300 Subject: [PATCH] Fix test --- src/Test/Unit/Block/Frontend/DaemonCollectorTest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Test/Unit/Block/Frontend/DaemonCollectorTest.php b/src/Test/Unit/Block/Frontend/DaemonCollectorTest.php index a1f9809..fb7e5f3 100644 --- a/src/Test/Unit/Block/Frontend/DaemonCollectorTest.php +++ b/src/Test/Unit/Block/Frontend/DaemonCollectorTest.php @@ -11,8 +11,7 @@ class DaemonCollectorTest extends \PHPUnit\Framework\TestCase public function setUp() { - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $context = $objectManager->getObject(\Magento\Framework\View\Element\Template\Context::class); + $context = $this->createMock(\Magento\Framework\View\Element\Template\Context::class); $customerSession = $this->createMock(\Magento\Customer\Model\Session::class); $storeManager = $this->createMock(\Magento\Store\Model\StoreManager::class); $storeResolver = $this->createMock(\Magento\Store\Model\StoreResolver::class); @@ -36,10 +35,13 @@ class DaemonCollectorTest extends \PHPUnit\Framework\TestCase ->method('getSiteKey') ->willReturn(self::SITE_KEY); + $context->expects($this->any()) + ->method('getStoreManager') + ->willReturn($storeManager); + $this->unit = new \Retailcrm\Retailcrm\Block\Frontend\DaemonCollector( $context, $customerSession, - $storeManager, $storeResolver, $helper );