@@ -90,20 +90,44 @@ public function testExecute()
90
90
$ attributeId = 15 ;
91
91
$ conditions = ['first ' , 'second ' ];
92
92
93
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )->with (Store::XML_PATH_PRICE_SCOPE )
93
+ $ this ->scopeConfigMock
94
+ ->expects ($ this ->once ())
95
+ ->method ('getValue ' )
96
+ ->with (Store::XML_PATH_PRICE_SCOPE )
94
97
->willReturn (Store::XML_PATH_PRICE_SCOPE );
95
- $ this ->attributeRepositoryMock ->expects ($ this ->once ())->method ('get ' )
98
+ $ this ->attributeRepositoryMock
99
+ ->expects ($ this ->once ())
100
+ ->method ('get ' )
96
101
->with (ProductAttributeInterface::ENTITY_TYPE_CODE , ProductAttributeInterface::CODE_PRICE )
97
102
->willReturn ($ this ->attributeMock );
98
- $ this ->attributeMock ->expects ($ this ->once ())->method ('getId ' )->willReturn ($ attributeId );
99
- $ this ->attributeMock ->expects ($ this ->once ())->method ('getBackend ' )->willReturn ($ this ->attributeBackendMock );
100
- $ this ->attributeBackendMock ->expects ($ this ->once ())->method ('getTable ' )->willReturn ($ table );
101
- $ this ->resourceConnectionMock ->expects ($ this ->once ())->method ('getConnection ' )->willReturn ($ this ->dbAdapterMock );
102
- $ this ->dbAdapterMock ->expects ($ this ->exactly (2 ))->method ('quoteInto ' )->willReturnMap ([
103
- ['attribute_id = ? ' , $ attributeId , null , null , $ conditions [0 ]],
104
- ['store_id != ? ' , Store::DEFAULT_STORE_ID , null , null , $ conditions [1 ]],
105
- ]);
106
- $ this ->dbAdapterMock ->expects ($ this ->once ())->method ('delete ' )->with ($ table , $ conditions );
103
+ $ this ->attributeMock
104
+ ->expects ($ this ->once ())
105
+ ->method ('getId ' )
106
+ ->willReturn ($ attributeId );
107
+ $ this ->attributeMock
108
+ ->expects ($ this ->once ())
109
+ ->method ('getBackend ' )
110
+ ->willReturn ($ this ->attributeBackendMock );
111
+ $ this ->attributeBackendMock
112
+ ->expects ($ this ->once ())
113
+ ->method ('getTable ' )
114
+ ->willReturn ($ table );
115
+ $ this ->resourceConnectionMock
116
+ ->expects ($ this ->once ())
117
+ ->method ('getConnection ' )
118
+ ->willReturn ($ this ->dbAdapterMock );
119
+ $ this ->dbAdapterMock
120
+ ->expects ($ this ->exactly (2 ))
121
+ ->method ('quoteInto ' )
122
+ ->willReturnMap ([
123
+ ['attribute_id = ? ' , $ attributeId , null , null , $ conditions [0 ]],
124
+ ['store_id != ? ' , Store::DEFAULT_STORE_ID , null , null , $ conditions [1 ]],
125
+ ]);
126
+ $ this ->dbAdapterMock
127
+ ->expects ($ this ->once ())
128
+ ->method ('delete ' )
129
+ ->with ($ table , $ conditions );
130
+
107
131
$ this ->deleteOutdatedPriceValues ->execute ();
108
132
}
109
133
@@ -115,10 +139,17 @@ public function testExecute()
115
139
*/
116
140
public function testExecutePriceConfigIsNotSetToGlobal ()
117
141
{
118
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )->with (Store::XML_PATH_PRICE_SCOPE )
142
+ $ this ->scopeConfigMock
143
+ ->expects ($ this ->once ())
144
+ ->method ('getValue ' )
145
+ ->with (Store::XML_PATH_PRICE_SCOPE )
119
146
->willReturn (null );
120
- $ this ->attributeRepositoryMock ->expects ($ this ->never ())->method ('get ' );
121
- $ this ->dbAdapterMock ->expects ($ this ->never ())->method ('delete ' );
147
+ $ this ->attributeRepositoryMock
148
+ ->expects ($ this ->never ())
149
+ ->method ('get ' );
150
+ $ this ->dbAdapterMock
151
+ ->expects ($ this ->never ())
152
+ ->method ('delete ' );
122
153
123
154
$ this ->deleteOutdatedPriceValues ->execute ();
124
155
}
0 commit comments