19
19
use Magento \Framework \Data \Collection \EntityFactory ;
20
20
use Magento \Framework \DB \Adapter \Pdo \Mysql ;
21
21
use Magento \Framework \Api \Filter ;
22
+ use Magento \Framework \Model \ResourceModel \Db \AbstractDb as ResourceModelAbstractDb ;
22
23
use Magento \Framework \Mview \View \Collection as MviewCollection ;
23
24
24
25
/**
@@ -62,14 +63,24 @@ class FulltextFilterTest extends \PHPUnit_Framework_TestCase
62
63
*/
63
64
protected $ collectionAbstractDbMock ;
64
65
66
+ /**
67
+ * @var ResourceModelAbstractDb|\PHPUnit_Framework_MockObject_MockObject
68
+ */
69
+ protected $ resourceModelAbstractDb ;
70
+
65
71
protected function setUp ()
66
72
{
67
73
$ this ->entityFactoryMock = $ this ->getMock (EntityFactory::class, [], [], '' , false );
68
74
$ this ->loggerMock = $ this ->getMock (LoggerInterface::class);
69
75
$ this ->fetchStrategyMock = $ this ->getMock (FetchStrategyInterface::class, [], [], '' , false );
76
+ $ this ->resourceModelAbstractDb = $ this ->getMock (FetchStrategyInterface::class, [], [], '' , false );
70
77
$ this ->connectionMock = $ this ->getMock (Mysql::class, ['select ' , 'getIndexList ' ], [], '' , false );
71
78
$ this ->selectMock = $ this ->getMock (Select::class, ['getPart ' , 'where ' ], [], '' , false );
72
79
80
+ $ this ->resourceModelAbstractDb = $ this ->getMockBuilder (ResourceModelAbstractDb::class)
81
+ ->disableOriginalConstructor ()
82
+ ->getMockForAbstractClass ();
83
+
73
84
$ this ->collectionAbstractDbMock = $ this ->getMockBuilder (CollectionAbstractDb::class)
74
85
->setMethods (['getConnection ' , 'getSelect ' , 'getMainTable ' ])
75
86
->disableOriginalConstructor ()
@@ -83,7 +94,7 @@ public function testApply()
83
94
$ filter = new Filter ();
84
95
$ filter ->setValue ('test ' );
85
96
86
- $ this ->connectionMock ->expects ($ this ->any ())
97
+ $ this ->collectionAbstractDbMock ->expects ($ this ->any ())
87
98
->method ('getMainTable ' )
88
99
->willReturn ('testTable ' );
89
100
0 commit comments