@@ -529,70 +529,20 @@ protected function _getModelMock($mockBeforeSave = false)
529
529
$ methods [] = 'beforeSave ' ;
530
530
}
531
531
532
- $ this ->_sitemapCategoryMock ->expects (
533
- $ this ->any ()
534
- )->method (
535
- 'getCollection '
536
- )->will (
537
- $ this ->returnValue (
538
- [
539
- new \Magento \Framework \DataObject (
540
- ['url ' => 'category.html ' , 'updated_at ' => '2012-12-21 00:00:00 ' ]
541
- ),
542
- new \Magento \Framework \DataObject (
543
- ['url ' => '/category/sub-category.html ' , 'updated_at ' => '2012-12-21 00:00:00 ' ]
544
- ),
545
- ]
546
- )
547
- );
548
-
549
532
$ storeBaseMediaUrl = 'http://store.com/pub/media/catalog/product/cache/c9e0b0ef589f3508e5ba515cde53c5ff/ ' ;
550
- $ this ->_sitemapProductMock ->expects (
551
- $ this ->any ()
552
- )->method (
553
- 'getCollection '
554
- )->will (
555
- $ this ->returnValue (
556
- [
557
- new \Magento \Framework \DataObject (
558
- ['url ' => 'product.html ' , 'updated_at ' => '2012-12-21 00:00:00 ' ]
559
- ),
560
- new \Magento \Framework \DataObject (
561
- [
562
- 'url ' => 'product2.html ' ,
563
- 'updated_at ' => '2012-12-21 00:00:00 ' ,
564
- 'images ' => new \Magento \Framework \DataObject (
565
- [
566
- 'collection ' => [
567
- new \Magento \Framework \DataObject (
568
- [
569
- 'url ' => $ storeBaseMediaUrl .'i/m/image1.png ' ,
570
- 'caption ' => 'caption & > title < " '
571
- ]
572
- ),
573
- new \Magento \Framework \DataObject (
574
- ['url ' => $ storeBaseMediaUrl .'i/m/image_no_caption.png ' , 'caption ' => null ]
575
- ),
576
- ],
577
- 'thumbnail ' => $ storeBaseMediaUrl .'t/h/thumbnail.jpg ' ,
578
- 'title ' => 'Product & > title < " ' ,
579
- ]
580
- ),
581
- ]
582
- ),
583
- ]
584
- )
585
- );
586
- $ this ->_sitemapCmsPageMock ->expects ($ this ->any ())->method ('getCollection ' )->will ($ this ->returnValue ([]));
587
533
588
534
$ this ->itemResolverMock ->expects (self ::any ())
589
535
->method ('getItems ' )
590
536
->willReturn ([
591
537
new SitemapItem ('category.html ' , '1.0 ' , 'daily ' , '2012-12-21 00:00:00 ' ),
592
538
new SitemapItem ('/category/sub-category.html ' , '1.0 ' , 'daily ' , '2012-12-21 00:00:00 ' ),
593
539
new SitemapItem ('product.html ' , '0.5 ' , 'monthly ' , '2012-12-21 00:00:00 ' ),
594
- new SitemapItem ('product2.html ' , '0.5 ' , 'monthly ' , '2012-12-21 00:00:00 ' , new \Magento \Framework \DataObject (
595
- [
540
+ new SitemapItem (
541
+ 'product2.html ' ,
542
+ '0.5 ' ,
543
+ 'monthly ' ,
544
+ '2012-12-21 00:00:00 ' ,
545
+ new \Magento \Framework \DataObject ([
596
546
'collection ' => [
597
547
new \Magento \Framework \DataObject (
598
548
[
@@ -606,8 +556,8 @@ protected function _getModelMock($mockBeforeSave = false)
606
556
],
607
557
'thumbnail ' => $ storeBaseMediaUrl .'t/h/thumbnail.jpg ' ,
608
558
'title ' => 'Product & > title < " ' ,
609
- ]
610
- ))
559
+ ])
560
+ )
611
561
]);
612
562
613
563
/** @var $model \Magento\Sitemap\Model\Sitemap */
@@ -643,30 +593,15 @@ protected function _getModelConstructorArgs()
643
593
{
644
594
$ categoryFactory = $ this ->getMockBuilder (
645
595
\Magento \Sitemap \Model \ResourceModel \Catalog \CategoryFactory::class
646
- )->setMethods (
647
- ['create ' ]
648
596
)->disableOriginalConstructor ()->getMock ();
649
- $ categoryFactory ->expects (
650
- $ this ->any ()
651
- )->method (
652
- 'create '
653
- )->will (
654
- $ this ->returnValue ($ this ->_sitemapCategoryMock )
655
- );
656
597
657
598
$ productFactory = $ this ->getMockBuilder (
658
599
\Magento \Sitemap \Model \ResourceModel \Catalog \ProductFactory::class
659
- )->setMethods (
660
- ['create ' ]
661
600
)->disableOriginalConstructor ()->getMock ();
662
- $ productFactory ->expects ($ this ->any ())->method ('create ' )->will ($ this ->returnValue ($ this ->_sitemapProductMock ));
663
601
664
602
$ cmsFactory = $ this ->getMockBuilder (
665
603
\Magento \Sitemap \Model \ResourceModel \Cms \PageFactory::class
666
- )->setMethods (
667
- ['create ' ]
668
604
)->disableOriginalConstructor ()->getMock ();
669
- $ cmsFactory ->expects ($ this ->any ())->method ('create ' )->will ($ this ->returnValue ($ this ->_sitemapCmsPageMock ));
670
605
671
606
$ this ->storeManagerMock = $ this ->getMockBuilder (\Magento \Store \Model \StoreManagerInterface::class)
672
607
->setMethods (['getStore ' ])
0 commit comments