aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/StatusTest.php
diff options
context:
space:
mode:
authordaniel <dkinzler@wikimedia.org>2022-08-31 22:00:59 +0200
committerDaniel Kinzler <dkinzler@wikimedia.org>2022-09-01 09:00:21 +0000
commit951966c63c35bb708ca35de1187de94383d61589 (patch)
tree14a2b54f3ff0f04f861e836b1b4718dea5138e44 /tests/phpunit/includes/StatusTest.php
parent7b88ee10c417748158ddda577f3a79d3244bf6b4 (diff)
downloadmediawikicore-951966c63c35bb708ca35de1187de94383d61589.tar.gz
mediawikicore-951966c63c35bb708ca35de1187de94383d61589.zip
Make StatusValue accept MessageValue.
This allows us to use MessageValue in more places. In particular, it improves code re-use between REST handlers (which use MessageValue) and old style API modules (which use Status a lot). Change-Id: I14f1d4444b725273675dd229d716ac6396752c90
Diffstat (limited to 'tests/phpunit/includes/StatusTest.php')
-rw-r--r--tests/phpunit/includes/StatusTest.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/phpunit/includes/StatusTest.php b/tests/phpunit/includes/StatusTest.php
index dc10f7e087b0..61ca4da5e773 100644
--- a/tests/phpunit/includes/StatusTest.php
+++ b/tests/phpunit/includes/StatusTest.php
@@ -283,9 +283,13 @@ class StatusTest extends MediaWikiLangTestCase {
$status = new Status();
$status->fatal( 'bad' );
$status->fatal( wfMessage( 'bad-msg' ) );
+ $status->fatal( new MessageValue( 'bad-msg-value' ) );
$this->assertTrue( $status->hasMessage( 'bad' ) );
$this->assertTrue( $status->hasMessage( 'bad-msg' ) );
$this->assertTrue( $status->hasMessage( wfMessage( 'bad-msg' ) ) );
+ $this->assertTrue( $status->hasMessage( wfMessage( 'bad-msg-value' ) ) );
+ $this->assertTrue( $status->hasMessage( new MessageValue( 'bad-msg' ) ) );
+ $this->assertTrue( $status->hasMessage( new MessageValue( 'bad-msg-value' ) ) );
$this->assertFalse( $status->hasMessage( 'good' ) );
}
@@ -508,8 +512,8 @@ class StatusTest extends MediaWikiLangTestCase {
];
$status = new Status();
- $status->warning( new Message( 'fooBar!', [ 'foo', 'bar' ] ) );
- $status->warning( new Message( 'fooBar2!' ) );
+ $status->warning( new MessageValue( 'fooBar!', [ 'foo', 'bar' ] ) );
+ $status->warning( new MessageValue( 'fooBar2!' ) );
$testCases['2MessageWarnings'] = [
$status,
[