File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
app/code/Magento/Newsletter Expand file tree Collapse file tree 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)
633633 $ this ->setStatus (self ::STATUS_SUBSCRIBED )
634634 ->setStatusChanged (true )
635635 ->save ();
636+
637+ $ this ->sendConfirmationSuccessEmail ();
636638 return true ;
637639 }
638640
Original file line number Diff line number Diff line change @@ -341,6 +341,21 @@ public function testConfirm()
341341 $ code = 111 ;
342342 $ this ->subscriber ->setCode ($ code );
343343 $ 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 ();
344359
345360 $ this ->assertTrue ($ this ->subscriber ->confirm ($ code ));
346361 }
You can’t perform that action at this time.
0 commit comments