9 $messageKey =
'some-message-key';
10 $messageParameter =
'some-parameter';
12 $statusValue->fatal( $messageKey, $messageParameter );
16 $gotMessage = $apiUsageException->getMessageObject();
18 $this->assertInstanceOf( \Message::class, $gotMessage );
19 $this->assertEquals( $messageKey, $gotMessage->getKey() );
20 $this->assertEquals( [ $messageParameter ], $gotMessage->getParams() );
24 $expectedMessage =
new Message(
'some-message-key', [
'some message parameter' ] );
25 $expectedCode =
'some-error-code';
26 $expectedData = [
'some-error-data' ];
35 $gotMessage = $apiUsageException->getMessageObject();
37 $this->assertInstanceOf( \ApiMessage::class, $gotMessage );
38 $this->assertEquals( $expectedMessage->getKey(), $gotMessage->getKey() );
39 $this->assertEquals( $expectedMessage->getParams(), $gotMessage->getParams() );
40 $this->assertEquals( $expectedCode, $gotMessage->getApiCode() );
41 $this->assertEquals( $expectedData, $gotMessage->getApiData() );