@@ -52,6 +52,7 @@ protected function setUp()
5252 ->disableOriginalConstructor ()->getMock ();
5353
5454 $ objectManagerHelper = new ObjectManagerHelper ($ this );
55+
5556 $ this ->controller = $ objectManagerHelper ->getObject (
5657 \Magento \Rss \Controller \Feed \Index::class,
5758 [
@@ -89,15 +90,27 @@ public function testExecuteWithException()
8990 $ this ->scopeConfigInterface ->expects ($ this ->once ())->method ('getValue ' )->will ($ this ->returnValue (true ));
9091 $ dataProvider = $ this ->getMock (\Magento \Framework \App \Rss \DataProviderInterface::class);
9192 $ dataProvider ->expects ($ this ->once ())->method ('isAllowed ' )->will ($ this ->returnValue (true ));
92-
93- $ rssModel = $ this ->getMock (\Magento \Rss \Model \Rss::class, ['setDataProvider ' ], [], '' , false );
94- $ rssModel ->expects ($ this ->once ())->method ('setDataProvider ' )->will ($ this ->returnSelf ());
93+ $ dataProvider ->expects ($ this ->once ())->method ('getRssData ' )->will ($ this ->returnValue ([]));
94+
95+ $ objectManagerHelper = new ObjectManagerHelper ($ this );
96+ $ feedImporter = $ objectManagerHelper ->getObject (
97+ \Magento \Framework \App \Feed \Importer::class,
98+ [
99+ 'feedProcessor ' => $ objectManagerHelper ->getObject (\Zend_Feed::class),
100+ ]
101+ );
102+ $ rssModel = $ objectManagerHelper ->getObject (
103+ \Magento \Rss \Model \Rss::class,
104+ [
105+ 'feedImporter ' => $ feedImporter ,
106+ ]
107+ );
95108
96109 $ this ->response ->expects ($ this ->once ())->method ('setHeader ' )->will ($ this ->returnSelf ());
97110 $ this ->rssFactory ->expects ($ this ->once ())->method ('create ' )->will ($ this ->returnValue ($ rssModel ));
98111 $ this ->rssManager ->expects ($ this ->once ())->method ('getProvider ' )->will ($ this ->returnValue ($ dataProvider ));
99112
100- $ this ->setExpectedException ('\Zend_Feed_Builder_Exception ' );
113+ $ this ->setExpectedException ('\Magento\Framework\Exception\FeedImporterException ' );
101114 $ this ->controller ->execute ();
102115 }
103116}
0 commit comments