@@ -36,11 +36,11 @@ protected function setUp()
36
36
'' ,
37
37
false
38
38
);
39
- $ eavConfig ->expects ($ this ->once ())->method ('getAttribute ' )->willReturn ($ this ->attributeMock );
39
+ $ eavConfig ->expects ($ this ->any ())->method ('getAttribute ' )->willReturn ($ this ->attributeMock );
40
40
$ ruleMock = $ this ->getMock (\Magento \SalesRule \Model \Rule::class, [], [], '' , false );
41
41
$ storeManager = $ this ->getMock (\Magento \Store \Model \StoreManagerInterface::class);
42
42
$ storeMock = $ this ->getMock (\Magento \Store \Api \Data \StoreInterface::class);
43
- $ storeManager ->expects ($ this ->once ())->method ('getStore ' )->willReturn ($ storeMock );
43
+ $ storeManager ->expects ($ this ->any ())->method ('getStore ' )->willReturn ($ storeMock );
44
44
$ this ->resourceMock = $ this ->getMock (
45
45
\Magento \Indexer \Model \ResourceModel \FrontendResource::class,
46
46
[],
@@ -49,8 +49,8 @@ protected function setUp()
49
49
false
50
50
);
51
51
$ productResource = $ this ->getMock (\Magento \Catalog \Model \ResourceModel \Product::class, [], [], '' , false );
52
- $ productResource ->expects ($ this ->once ())->method ('loadAllAttributes ' )->willReturnSelf ();
53
- $ productResource ->expects ($ this ->once ())->method ('getAttributesByCode ' )->willReturn ([]);
52
+ $ productResource ->expects ($ this ->any ())->method ('loadAllAttributes ' )->willReturnSelf ();
53
+ $ productResource ->expects ($ this ->any ())->method ('getAttributesByCode ' )->willReturn ([]);
54
54
$ this ->model = $ objectManagerHelper ->getObject (
55
55
\Magento \CatalogWidget \Model \Rule \Condition \Product::class,
56
56
[
@@ -88,4 +88,10 @@ public function testAddToCollection()
88
88
$ this ->resourceMock ->expects ($ this ->once ())->method ('getMainTable ' )->willReturn ('catalog_product_index_eav ' );
89
89
$ this ->model ->addToCollection ($ collectionMock );
90
90
}
91
+
92
+ public function testGetMappedSqlFieldSku ()
93
+ {
94
+ $ this ->model ->setAttribute ('sku ' );
95
+ $ this ->assertEquals ('e.sku ' , $ this ->model ->getMappedSqlField ());
96
+ }
91
97
}
0 commit comments