File tree 2 files changed +17
-0
lines changed
app/code/Magento/Newsletter
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -633,6 +633,8 @@ public function confirm($code)
633
633
$ this ->setStatus (self ::STATUS_SUBSCRIBED )
634
634
->setStatusChanged (true )
635
635
->save ();
636
+
637
+ $ this ->sendConfirmationSuccessEmail ();
636
638
return true ;
637
639
}
638
640
Original file line number Diff line number Diff line change @@ -341,6 +341,21 @@ public function testConfirm()
341
341
$ code = 111 ;
342
342
$ this ->subscriber ->setCode ($ code );
343
343
$ this ->resource ->expects ($ this ->once ())->method ('save ' )->willReturnSelf ();
344
+ $ storeModel = $ this ->getMockBuilder (\Magento \Store \Model \Store::class)
345
+ ->disableOriginalConstructor ()
346
+ ->setMethods (['getId ' ])
347
+ ->getMock ();
348
+ $ transport = $ this ->createMock (\Magento \Framework \Mail \TransportInterface::class);
349
+ $ this ->scopeConfig ->expects ($ this ->any ())->method ('getValue ' )->willReturn (true );
350
+ $ this ->transportBuilder ->expects ($ this ->once ())->method ('setTemplateIdentifier ' )->willReturnSelf ();
351
+ $ this ->transportBuilder ->expects ($ this ->once ())->method ('setTemplateOptions ' )->willReturnSelf ();
352
+ $ this ->transportBuilder ->expects ($ this ->once ())->method ('setTemplateVars ' )->willReturnSelf ();
353
+ $ this ->transportBuilder ->expects ($ this ->once ())->method ('setFrom ' )->willReturnSelf ();
354
+ $ this ->transportBuilder ->expects ($ this ->once ())->method ('addTo ' )->willReturnSelf ();
355
+ $ this ->storeManager ->expects ($ this ->any ())->method ('getStore ' )->willReturn ($ storeModel );
356
+ $ storeModel ->expects ($ this ->any ())->method ('getId ' )->willReturn (1 );
357
+ $ this ->transportBuilder ->expects ($ this ->once ())->method ('getTransport ' )->willReturn ($ transport );
358
+ $ transport ->expects ($ this ->once ())->method ('sendMessage ' )->willReturnSelf ();
344
359
345
360
$ this ->assertTrue ($ this ->subscriber ->confirm ($ code ));
346
361
}
You can’t perform that action at this time.
0 commit comments