@@ -139,34 +139,30 @@ protected function setUp(): void
139
139
->disableOriginalConstructor ()
140
140
->getMock ();
141
141
142
- $ this ->resourceMock ->expects ($ this ->any ())
143
- ->method ('addCommitCallback ' )
142
+ $ this ->resourceMock ->method ('addCommitCallback ' )
144
143
->willReturnSelf ();
145
144
146
145
$ this ->fileMock = $ this ->createMock (Write::class);
147
146
148
147
$ this ->directoryMock = $ this ->createMock (DirectoryWrite::class);
149
148
150
- $ this ->directoryMock ->expects ($ this ->any ())
151
- ->method ('openFile ' )
149
+ $ this ->directoryMock ->method ('openFile ' )
152
150
->willReturn ($ this ->fileMock );
153
151
154
152
$ this ->filesystemMock = $ this ->getMockBuilder (Filesystem::class)
155
153
->setMethods (['getDirectoryWrite ' ])
156
154
->disableOriginalConstructor ()
157
155
->getMock ();
158
156
159
- $ this ->filesystemMock ->expects ($ this ->any ())
160
- ->method ('getDirectoryWrite ' )
157
+ $ this ->filesystemMock ->method ('getDirectoryWrite ' )
161
158
->willReturn ($ this ->directoryMock );
162
159
163
160
$ this ->configReaderMock = $ this ->getMockForAbstractClass (SitemapConfigReaderInterface::class);
164
161
$ this ->itemProviderMock = $ this ->getMockForAbstractClass (ItemProviderInterface::class);
165
162
$ this ->request = $ this ->createMock (Http::class);
166
163
$ this ->store = $ this ->createPartialMock (Store::class, ['isFrontUrlSecure ' , 'getBaseUrl ' ]);
167
164
$ this ->storeManagerMock = $ this ->getMockForAbstractClass (StoreManagerInterface::class);
168
- $ this ->storeManagerMock ->expects ($ this ->any ())
169
- ->method ('getStore ' )
165
+ $ this ->storeManagerMock ->method ('getStore ' )
170
166
->willReturn ($ this ->store );
171
167
}
172
168
@@ -467,12 +463,10 @@ function ($from, $to) {
467
463
if (isset ($ robotsInfo ['robotsFinish ' ])) {
468
464
$ robotsFinish = $ robotsInfo ['robotsFinish ' ];
469
465
}
470
- $ this ->directoryMock ->expects ($ this ->any ())
471
- ->method ('readFile ' )
466
+ $ this ->directoryMock ->method ('readFile ' )
472
467
->willReturn ($ robotsStart );
473
468
474
- $ this ->directoryMock ->expects ($ this ->any ())
475
- ->method ('writeFile ' )
469
+ $ this ->directoryMock ->method ('writeFile ' )
476
470
->with (
477
471
$ this ->equalTo ('robots.txt ' ),
478
472
$ this ->equalTo ($ robotsFinish )
@@ -483,16 +477,13 @@ function ($from, $to) {
483
477
if (isset ($ robotsInfo ['pushToRobots ' ])) {
484
478
$ pushToRobots = (int )$ robotsInfo ['pushToRobots ' ];
485
479
}
486
- $ this ->configReaderMock ->expects ($ this ->any ())
487
- ->method ('getMaximumLinesNumber ' )
480
+ $ this ->configReaderMock ->method ('getMaximumLinesNumber ' )
488
481
->willReturn ($ maxLines );
489
482
490
- $ this ->configReaderMock ->expects ($ this ->any ())
491
- ->method ('getMaximumFileSize ' )
483
+ $ this ->configReaderMock ->method ('getMaximumFileSize ' )
492
484
->willReturn ($ maxFileSize );
493
485
494
- $ this ->configReaderMock ->expects ($ this ->any ())
495
- ->method ('getEnableSubmissionRobots ' )
486
+ $ this ->configReaderMock ->method ('getEnableSubmissionRobots ' )
496
487
->willReturn ($ pushToRobots );
497
488
498
489
$ model = $ this ->getModelMock (true );
@@ -535,8 +526,7 @@ protected function getModelMock($mockBeforeSave = false)
535
526
536
527
$ storeBaseMediaUrl = 'http://store.com/media/catalog/product/cache/c9e0b0ef589f3508e5ba515cde53c5ff/ ' ;
537
528
538
- $ this ->itemProviderMock ->expects ($ this ->any ())
539
- ->method ('getItems ' )
529
+ $ this ->itemProviderMock ->method ('getItems ' )
540
530
->willReturn (
541
531
[
542
532
new SitemapItem ('category.html ' , '1.0 ' , 'daily ' , '2012-12-21 00:00:00 ' ),
@@ -659,16 +649,13 @@ public function testGetSitemapUrl($storeBaseUrl, $documentRoot, $baseDir, $sitem
659
649
->setConstructorArgs ($ this ->getModelConstructorArgs ())
660
650
->getMock ();
661
651
662
- $ model ->expects ($ this ->any ())
663
- ->method ('_getStoreBaseUrl ' )
652
+ $ model ->method ('_getStoreBaseUrl ' )
664
653
->willReturn ($ storeBaseUrl );
665
654
666
- $ model ->expects ($ this ->any ())
667
- ->method ('_getDocumentRoot ' )
655
+ $ model ->method ('_getDocumentRoot ' )
668
656
->willReturn ($ documentRoot );
669
657
670
- $ model ->expects ($ this ->any ())
671
- ->method ('_getBaseDir ' )
658
+ $ model ->method ('_getBaseDir ' )
672
659
->willReturn ($ baseDir );
673
660
674
661
$ this ->assertEquals ($ result , $ model ->getSitemapUrl ($ sitemapPath , $ sitemapFileName ));
0 commit comments