Skip to content

Commit 5cb3c28

Browse files
author
Maksym Savich
committed
MAGETWO-35462: Refactor \Magento\Framework\Model\Resource\Db\AbstractDb only update changed fields
- CR fixes
1 parent c825f3f commit 5cb3c28

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/internal/Magento/Framework/Model/Test/Unit/Resource/Db/AbstractDbTest.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,8 @@ public function hasDataChangedDataProvider()
431431
public function testPrepareDataForUpdate()
432432
{
433433
$adapterInterfaceMock = $this->getMock('\Magento\Framework\DB\Adapter\AdapterInterface', [], [], '', false);
434-
$contextMock = new \Magento\Framework\Model\Context(
435-
$this->getMock('Psr\Log\LoggerInterface'),
436-
$this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false),
437-
$this->getMock('Magento\Framework\App\CacheInterface', [], [], '', false),
438-
$this->getMock('Magento\Framework\App\State', [], [], '', false),
439-
$this->getMock('\Magento\Framework\Model\ActionValidator\RemoveAction', [], [], '', false),
440-
$this->getMock('\Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', [], [], '', false)
434+
$context = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject(
435+
'Magento\Framework\Model\Context'
441436
);
442437
$registryMock = $this->getMock('\Magento\Framework\Registry', [], [], '', false);
443438
$resourceMock = $this->getMock(
@@ -460,7 +455,7 @@ public function testPrepareDataForUpdate()
460455
$resourceCollectionMock = $this->getMock('Magento\Framework\Data\Collection\Db', [], [], '', false);
461456
$abstractModelMock = $this->getMockForAbstractClass(
462457
'Magento\Framework\Model\AbstractModel',
463-
[$contextMock, $registryMock, $resourceMock, $resourceCollectionMock]
458+
[$context, $registryMock, $resourceMock, $resourceCollectionMock]
464459
);
465460
$data = 'tableName';
466461
$this->_resourcesMock->expects($this->any())

0 commit comments

Comments
 (0)