File tree Expand file tree Collapse file tree 3 files changed +75
-0
lines changed
performance-toolkit/config
src/Magento/Setup/Framework/Mail Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Original file line number Diff line number Diff line change 66 */
77-->
88<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
9+ <preference for =" Magento\Framework\Mail\TransportInterface" type =" Magento\Setup\Framework\Mail\TransportInterfaceMock" />
10+ <preference for =" Magento\Framework\Mail\Template\TransportBuilder" type =" Magento\Setup\Framework\Mail\Template\TransportBuilderMock" />
911</config >
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+ declare (strict_types=1 );
7+
8+ namespace Magento \Setup \Framework \Mail \Template ;
9+
10+ use Magento \Framework \Mail \Template \TransportBuilder ;
11+ use Magento \Setup \Framework \Mail \TransportInterfaceMock ;
12+
13+ /**
14+ * Mock for mail template transport builder.
15+ */
16+ class TransportBuilderMock extends TransportBuilder
17+ {
18+ /**
19+ * @inheritDoc
20+ */
21+ public function getTransport ()
22+ {
23+ $ this ->prepareMessage ();
24+ $ this ->reset ();
25+
26+ return new TransportInterfaceMock ($ this ->message );
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+ declare (strict_types=1 );
7+
8+ namespace Magento \Setup \Framework \Mail ;
9+
10+ use Magento \Framework \Mail \EmailMessageInterface ;
11+ use Magento \Framework \Mail \TransportInterface ;
12+
13+ /**
14+ * Mock for mail transport.
15+ */
16+ class TransportInterfaceMock implements TransportInterface
17+ {
18+ /**
19+ * @var EmailMessageInterface|null
20+ */
21+ private $ message ;
22+
23+ /**
24+ * @param EmailMessageInterface|null $message
25+ */
26+ public function __construct ($ message = null )
27+ {
28+ $ this ->message = $ message ;
29+ }
30+
31+ /**
32+ * @inheritDoc
33+ */
34+ public function sendMessage ()
35+ {
36+ }
37+
38+ /**
39+ * @inheritDoc
40+ */
41+ public function getMessage ()
42+ {
43+ return $ this ->message ;
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments