Skip to content

Commit 095c6e8

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-50620-GlobalSearchEntityTestVariation4-failure' into PR_Branch
2 parents f5094ce + 346727f commit 095c6e8

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/FulltextFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function apply(Collection $collection, Filter $filter)
7575
throw new \InvalidArgumentException('Database collection required.');
7676
}
7777

78-
$mainTable = $collection->getResource()->getMainTable();
78+
$mainTable = $collection->getMainTable();
7979
/** @var AbstractDb $collection */
8080
$columns = $this->getFulltextIndexColumns($collection, $mainTable);
8181
if (!$columns) {

lib/internal/Magento/Framework/View/Test/Unit/Element/UiComponent/DataProvider/FulltextFilterTest.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Magento\Framework\Data\Collection\EntityFactory;
2020
use Magento\Framework\DB\Adapter\Pdo\Mysql;
2121
use Magento\Framework\Api\Filter;
22-
use Magento\Framework\Model\ResourceModel\Db\AbstractDb as ResourceModelAbstractDb;
2322
use Magento\Framework\Mview\View\Collection as MviewCollection;
2423

2524
/**
@@ -63,27 +62,16 @@ class FulltextFilterTest extends \PHPUnit_Framework_TestCase
6362
*/
6463
protected $collectionAbstractDbMock;
6564

66-
/**
67-
* @var ResourceModelAbstractDb|\PHPUnit_Framework_MockObject_MockObject
68-
*/
69-
protected $resourceModelAbstractDb;
70-
7165
protected function setUp()
7266
{
7367
$this->entityFactoryMock = $this->getMock(EntityFactory::class, [], [], '', false);
7468
$this->loggerMock = $this->getMock(LoggerInterface::class);
7569
$this->fetchStrategyMock = $this->getMock(FetchStrategyInterface::class, [], [], '', false);
76-
$this->resourceModelAbstractDb = $this->getMock(FetchStrategyInterface::class, [], [], '', false);
7770
$this->connectionMock = $this->getMock(Mysql::class, ['select', 'getIndexList'], [], '', false);
7871
$this->selectMock = $this->getMock(Select::class, ['getPart', 'where'], [], '', false);
7972

80-
$this->resourceModelAbstractDb = $this->getMockBuilder(ResourceModelAbstractDb::class)
81-
->setMethods(['getMainTable'])
82-
->disableOriginalConstructor()
83-
->getMockForAbstractClass();
84-
8573
$this->collectionAbstractDbMock = $this->getMockBuilder(CollectionAbstractDb::class)
86-
->setMethods(['getConnection', 'getResource', 'getSelect'])
74+
->setMethods(['getConnection', 'getSelect', 'getMainTable'])
8775
->disableOriginalConstructor()
8876
->getMockForAbstractClass();
8977

@@ -95,7 +83,7 @@ public function testApply()
9583
$filter = new Filter();
9684
$filter->setValue('test');
9785

98-
$this->resourceModelAbstractDb->expects($this->any())
86+
$this->connectionMock->expects($this->any())
9987
->method('getMainTable')
10088
->willReturn('testTable');
10189

@@ -117,9 +105,6 @@ public function testApply()
117105
->method('where')
118106
->willReturn(null);
119107

120-
$this->collectionAbstractDbMock->expects($this->once())
121-
->method('getResource')
122-
->willReturn($this->resourceModelAbstractDb);
123108
$this->collectionAbstractDbMock->expects($this->exactly(2))
124109
->method('getSelect')
125110
->willReturn($this->selectMock);

0 commit comments

Comments
 (0)