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 ;
23
22
use Magento \Framework \Mview \View \Collection as MviewCollection ;
24
23
25
24
/**
@@ -63,27 +62,16 @@ class FulltextFilterTest extends \PHPUnit_Framework_TestCase
63
62
*/
64
63
protected $ collectionAbstractDbMock ;
65
64
66
- /**
67
- * @var ResourceModelAbstractDb|\PHPUnit_Framework_MockObject_MockObject
68
- */
69
- protected $ resourceModelAbstractDb ;
70
-
71
65
protected function setUp ()
72
66
{
73
67
$ this ->entityFactoryMock = $ this ->getMock (EntityFactory::class, [], [], '' , false );
74
68
$ this ->loggerMock = $ this ->getMock (LoggerInterface::class);
75
69
$ this ->fetchStrategyMock = $ this ->getMock (FetchStrategyInterface::class, [], [], '' , false );
76
- $ this ->resourceModelAbstractDb = $ this ->getMock (FetchStrategyInterface::class, [], [], '' , false );
77
70
$ this ->connectionMock = $ this ->getMock (Mysql::class, ['select ' , 'getIndexList ' ], [], '' , false );
78
71
$ this ->selectMock = $ this ->getMock (Select::class, ['getPart ' , 'where ' ], [], '' , false );
79
72
80
- $ this ->resourceModelAbstractDb = $ this ->getMockBuilder (ResourceModelAbstractDb::class)
81
- ->setMethods (['getMainTable ' ])
82
- ->disableOriginalConstructor ()
83
- ->getMockForAbstractClass ();
84
-
85
73
$ this ->collectionAbstractDbMock = $ this ->getMockBuilder (CollectionAbstractDb::class)
86
- ->setMethods (['getConnection ' , 'getResource ' , 'getSelect ' ])
74
+ ->setMethods (['getConnection ' , 'getSelect ' , 'getMainTable ' ])
87
75
->disableOriginalConstructor ()
88
76
->getMockForAbstractClass ();
89
77
@@ -95,7 +83,7 @@ public function testApply()
95
83
$ filter = new Filter ();
96
84
$ filter ->setValue ('test ' );
97
85
98
- $ this ->resourceModelAbstractDb ->expects ($ this ->any ())
86
+ $ this ->connectionMock ->expects ($ this ->any ())
99
87
->method ('getMainTable ' )
100
88
->willReturn ('testTable ' );
101
89
@@ -117,9 +105,6 @@ public function testApply()
117
105
->method ('where ' )
118
106
->willReturn (null );
119
107
120
- $ this ->collectionAbstractDbMock ->expects ($ this ->once ())
121
- ->method ('getResource ' )
122
- ->willReturn ($ this ->resourceModelAbstractDb );
123
108
$ this ->collectionAbstractDbMock ->expects ($ this ->exactly (2 ))
124
109
->method ('getSelect ' )
125
110
->willReturn ($ this ->selectMock );
0 commit comments