Skip to content

Commit 906441d

Browse files
author
lykhachov
committed
added AdditionalColumnProcessorFactory class to unit tests
1 parent c9b866e commit 906441d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\DB\Ddl\Table;
1313
use Magento\Framework\DB\Select;
1414
use Magento\Framework\Mview\Config;
15+
use Magento\Framework\Mview\View\AdditionalColumnsProcessor\ProcessorFactory;
1516
use Magento\Framework\Mview\View\Changelog;
1617
use Magento\Framework\Mview\View\ChangelogInterface;
1718
use PHPUnit\Framework\MockObject\MockObject;
@@ -41,13 +42,19 @@ class ChangelogTest extends TestCase
4142
*/
4243
protected $resourceMock;
4344

45+
/**
46+
* @var ProcessorFactory|MockObject
47+
*/
48+
protected $processorFactory;
49+
4450
protected function setUp(): void
4551
{
4652
$this->connectionMock = $this->createMock(Mysql::class);
4753
$this->resourceMock = $this->createMock(ResourceConnection::class);
4854
$this->mockGetConnection($this->connectionMock);
55+
$this->processorFactory = $this->createMock(ProcessorFactory::class);
4956

50-
$this->model = new Changelog($this->resourceMock, $this->getMviewConfigMock());
57+
$this->model = new Changelog($this->resourceMock, $this->getMviewConfigMock(), $this->processorFactory);
5158
}
5259

5360
/**
@@ -69,7 +76,7 @@ public function testInstanceOf()
6976
$resourceMock =
7077
$this->createMock(ResourceConnection::class);
7178
$resourceMock->expects($this->once())->method('getConnection')->willReturn(true);
72-
$model = new Changelog($resourceMock, $this->getMviewConfigMock());
79+
$model = new Changelog($resourceMock, $this->getMviewConfigMock(), $this->processorFactory);
7380
$this->assertInstanceOf(ChangelogInterface::class, $model);
7481
}
7582

@@ -80,7 +87,7 @@ public function testCheckConnectionException()
8087
$resourceMock =
8188
$this->createMock(ResourceConnection::class);
8289
$resourceMock->expects($this->once())->method('getConnection')->willReturn(null);
83-
$model = new Changelog($resourceMock, $this->getMviewConfigMock());
90+
$model = new Changelog($resourceMock, $this->getMviewConfigMock(), $this->processorFactory);
8491
$model->setViewId('ViewIdTest');
8592
$this->assertNull($model);
8693
}

0 commit comments

Comments
 (0)