File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ class ShipmentSenderTest extends \PHPUnit\Framework\TestCase
36
36
/** @var int */
37
37
private $ minErrorDefaultValue ;
38
38
39
+ /** @var string */
40
+ private $ defaultMode ;
41
+
39
42
/**
40
43
* @var CustomerRepository
41
44
*/
@@ -49,7 +52,9 @@ protected function setUp(): void
49
52
parent ::setUp ();
50
53
51
54
$ this ->objectManager = Bootstrap::getObjectManager ();
52
- $ this ->objectManager ->get (\Magento \Framework \App \State::class)->setMode (State::MODE_PRODUCTION );
55
+ $ stateObject = $ this ->objectManager ->get (\Magento \Framework \App \State::class);
56
+ $ this ->defaultMode = $ stateObject ->getMode ();
57
+ $ stateObject ->setMode (State::MODE_DEFAULT );
53
58
$ this ->logger = $ this ->objectManager ->get (Logger::class);
54
59
$ reflection = new \ReflectionClass (get_class ($ this ->logger ));
55
60
$ reflectionProperty = $ reflection ->getProperty ('minimumErrorLevel ' );
@@ -228,5 +233,8 @@ protected function tearDown(): void
228
233
$ reflectionProperty = new \ReflectionProperty (get_class ($ this ->logger ), 'minimumErrorLevel ' );
229
234
$ reflectionProperty ->setAccessible (true );
230
235
$ reflectionProperty ->setValue ($ this ->logger , $ this ->minErrorDefaultValue );
236
+
237
+ $ stateObject = $ this ->objectManager ->get (\Magento \Framework \App \State::class);
238
+ $ stateObject ->setMode ($ this ->defaultMode );
231
239
}
232
240
}
You can’t perform that action at this time.
0 commit comments