@@ -105,7 +105,7 @@ public function testSetCategoryUrlAndCategoryPath()
105
105
$ this ->category ->expects ($ this ->once ())->method ('setUrlKey ' )->with ('urk_key ' )->willReturnSelf ();
106
106
$ this ->categoryUrlPathGenerator ->expects ($ this ->once ())->method ('getUrlPath ' )->willReturn ('url_path ' );
107
107
$ this ->category ->expects ($ this ->once ())->method ('setUrlPath ' )->with ('url_path ' )->willReturnSelf ();
108
- $ this ->category ->expects ($ this ->atLeastOnce ( ))->method ('isObjectNew ' )->willReturn (true );
108
+ $ this ->category ->expects ($ this ->exactly ( 2 ))->method ('isObjectNew ' )->willReturn (true );
109
109
110
110
$ this ->categoryUrlPathAutogeneratorObserver ->execute ($ this ->observer );
111
111
}
@@ -149,7 +149,7 @@ public function testUrlKeyAndUrlPathUpdating()
149
149
$ this ->category ->expects ($ this ->once ())->method ('setUrlKey ' )->with ('url_key ' )->willReturnSelf ();
150
150
$ this ->category ->expects ($ this ->once ())->method ('setUrlPath ' )->with ('url_path ' )->willReturnSelf ();
151
151
// break code execution
152
- $ this ->category ->expects ($ this ->atLeastOnce ( ))->method ('isObjectNew ' )->willReturn (true );
152
+ $ this ->category ->expects ($ this ->exactly ( 2 ))->method ('isObjectNew ' )->willReturn (true );
153
153
154
154
$ this ->categoryUrlPathAutogeneratorObserver ->execute ($ this ->observer );
155
155
}
@@ -163,7 +163,7 @@ public function testUrlPathAttributeNoUpdatingIfCategoryIsNew()
163
163
$ this ->category ->expects ($ this ->any ())->method ('setUrlKey ' )->willReturnSelf ();
164
164
$ this ->category ->expects ($ this ->any ())->method ('setUrlPath ' )->willReturnSelf ();
165
165
166
- $ this ->category ->expects ($ this ->atLeastOnce ( ))->method ('isObjectNew ' )->willReturn (true );
166
+ $ this ->category ->expects ($ this ->exactly ( 2 ))->method ('isObjectNew ' )->willReturn (true );
167
167
$ this ->categoryResource ->expects ($ this ->never ())->method ('saveAttribute ' );
168
168
169
169
$ this ->categoryUrlPathAutogeneratorObserver ->execute ($ this ->observer );
@@ -177,7 +177,7 @@ public function testUrlPathAttributeUpdating()
177
177
$ this ->category ->expects ($ this ->any ())->method ('getUrlKey ' )->willReturn ('not_formatted_url_key ' );
178
178
$ this ->category ->expects ($ this ->any ())->method ('setUrlKey ' )->willReturnSelf ();
179
179
$ this ->category ->expects ($ this ->any ())->method ('setUrlPath ' )->willReturnSelf ();
180
- $ this ->category ->expects ($ this ->atLeastOnce ( ))->method ('isObjectNew ' )->willReturn (false );
180
+ $ this ->category ->expects ($ this ->exactly ( 2 ))->method ('isObjectNew ' )->willReturn (false );
181
181
182
182
$ this ->categoryResource ->expects ($ this ->once ())->method ('saveAttribute ' )->with ($ this ->category , 'url_path ' );
183
183
@@ -197,7 +197,7 @@ public function testChildrenUrlPathAttributeNoUpdatingIfParentUrlPathIsNotChange
197
197
$ this ->category ->expects ($ this ->any ())->method ('getUrlKey ' )->willReturn ('not_formatted_url_key ' );
198
198
$ this ->category ->expects ($ this ->any ())->method ('setUrlKey ' )->willReturnSelf ();
199
199
$ this ->category ->expects ($ this ->any ())->method ('setUrlPath ' )->willReturnSelf ();
200
- $ this ->category ->expects ($ this ->atLeastOnce ( ))->method ('isObjectNew ' )->willReturn (false );
200
+ $ this ->category ->expects ($ this ->exactly ( 2 ))->method ('isObjectNew ' )->willReturn (false );
201
201
// break code execution
202
202
$ this ->category ->expects ($ this ->once ())->method ('dataHasChangedFor ' )->with ('url_path ' )->willReturn (false );
203
203
@@ -212,7 +212,7 @@ public function testChildrenUrlPathAttributeUpdatingForSpecificStore()
212
212
$ this ->category ->expects ($ this ->any ())->method ('getUrlKey ' )->willReturn ('not_formatted_url_key ' );
213
213
$ this ->category ->expects ($ this ->any ())->method ('setUrlKey ' )->willReturnSelf ();
214
214
$ this ->category ->expects ($ this ->any ())->method ('setUrlPath ' )->willReturnSelf ();
215
- $ this ->category ->expects ($ this ->atLeastOnce ( ))->method ('isObjectNew ' )->willReturn (false );
215
+ $ this ->category ->expects ($ this ->exactly ( 2 ))->method ('isObjectNew ' )->willReturn (false );
216
216
$ this ->category ->expects ($ this ->any ())->method ('dataHasChangedFor ' )->willReturn (true );
217
217
// only for specific store
218
218
$ this ->category ->expects ($ this ->atLeastOnce ())->method ('getStoreId ' )->willReturn (1 );
0 commit comments