File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ protected function _construct()
54
54
*/
55
55
public function getRssData ()
56
56
{
57
- $ newUrl = $ this ->rssUrlBuilder ->getUrl (['_secure ' => true , '_nosecret ' => true , 'type ' => 'notifystock ' ]);
58
- $ title = __ ('Low Stock Products ' );
57
+ $ newUrl = $ this ->rssUrlBuilder ->getUrl (['_secure ' => true , '_nosecret ' => true , 'type ' => 'notifystock ' ]);
58
+ $ title = __ ('Low Stock Products ' )-> render () ;
59
59
$ data = ['title ' => $ title , 'description ' => $ title , 'link ' => $ newUrl , 'charset ' => 'UTF-8 ' ];
60
60
61
61
foreach ($ this ->rssModel ->getProductsCollection () as $ item ) {
@@ -65,7 +65,7 @@ public function getRssData()
65
65
['id ' => $ item ->getId (), '_secure ' => true , '_nosecret ' => true ]
66
66
);
67
67
$ qty = 1 * $ item ->getQty ();
68
- $ description = __ ('%1 has reached a quantity of %2. ' , $ item ->getName (), $ qty );
68
+ $ description = __ ('%1 has reached a quantity of %2. ' , $ item ->getName (), $ qty )-> render () ;
69
69
$ data ['entries ' ][] = ['title ' => $ item ->getName (), 'link ' => $ url , 'description ' => $ description ];
70
70
}
71
71
Original file line number Diff line number Diff line change @@ -96,7 +96,12 @@ public function testGetRssData()
96
96
$ this ->urlBuilder ->expects ($ this ->once ())->method ('getUrl ' )
97
97
->with ('catalog/product/edit ' , ['id ' => 1 , '_secure ' => true , '_nosecret ' => true ])
98
98
->will ($ this ->returnValue ('http://magento.com/catalog/product/edit/id/1 ' ));
99
- $ this ->assertEquals ($ this ->rssFeed , $ this ->block ->getRssData ());
99
+
100
+ $ data = $ this ->block ->getRssData ();
101
+ $ this ->assertTrue (is_string ($ data ['title ' ]));
102
+ $ this ->assertTrue (is_string ($ data ['description ' ]));
103
+ $ this ->assertTrue (is_string ($ data ['entries ' ][0 ]['description ' ]));
104
+ $ this ->assertEquals ($ this ->rssFeed , $ data );
100
105
}
101
106
102
107
public function testGetCacheLifetime ()
You can’t perform that action at this time.
0 commit comments