We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec04426 commit 3a5862eCopy full SHA for 3a5862e
lib/internal/Magento/Framework/Exception/Test/Unit/LocalizedExceptionTest.php
@@ -150,4 +150,16 @@ public function testGetLogMessage()
150
$expectedLogMessage = 'message parameter1 parameter2';
151
$this->assertEquals($expectedLogMessage, $localizeException->getLogMessage());
152
}
153
+
154
+ public function testGetCode()
155
+ {
156
+ $expectedCode = 42;
157
+ $localizedException = new LocalizedException(
158
+ new Phrase("message %1", ['test']),
159
+ new \Exception(),
160
+ $expectedCode
161
+ );
162
163
+ $this->assertEquals($expectedCode, $localizedException->getCode());
164
+ }
165
0 commit comments