@@ -64,18 +64,19 @@ class ObserverTest extends \PHPUnit\Framework\TestCase
64
64
65
65
protected function setUp ()
66
66
{
67
- $ this ->objectManagerMock = $ this ->getMockBuilder (\Magento \Framework \ObjectManagerInterface::class)
68
- ->getMock ();
69
- $ this ->scopeConfigMock = $ this ->getMockBuilder (\Magento \Framework \App \Config \ScopeConfigInterface::class)
70
- ->getMock ();
67
+ $ this ->objectManagerMock = $ this ->createMock (
68
+ \Magento \Framework \ObjectManagerInterface::class
69
+ );
70
+ $ this ->scopeConfigMock = $ this ->createMock (
71
+ \Magento \Framework \App \Config \ScopeConfigInterface::class
72
+ );
71
73
$ this ->collectionFactoryMock = $ this ->getMockBuilder (
72
74
\Magento \Sitemap \Model \ResourceModel \Sitemap \CollectionFactory::class
73
75
)->disableOriginalConstructor ()
74
76
->setMethods (['create ' ])
75
77
->getMock ();
76
- $ this ->sitemapCollectionMock = $ this ->createPartialMock (
77
- \Magento \Sitemap \Model \ResourceModel \Sitemap \Collection::class,
78
- ['getIterator ' ]
78
+ $ this ->sitemapCollectionMock = $ this ->createMock (
79
+ \Magento \Sitemap \Model \ResourceModel \Sitemap \Collection::class
79
80
);
80
81
$ this ->sitemapMock = $ this ->createPartialMock (
81
82
\Magento \Sitemap \Model \Sitemap::class,
@@ -130,6 +131,10 @@ public function testScheduledGenerateSitemapsSendsExceptionEmail()
130
131
)
131
132
->
willReturn (
'[email protected] ' );
132
133
134
+ $ this ->emailNotificationMock ->expects ($ this ->once ())
135
+ ->method ('sendErrors ' )
136
+ ->with (['Sitemap Exception ' ]);
137
+
133
138
$ this ->observer ->scheduledGenerateSitemaps ();
134
139
}
135
140
}
0 commit comments