From: addshore Date: Mon, 20 Nov 2017 09:39:55 +0000 (+0000) Subject: Tests for TitleValue::__toString X-Git-Tag: 1.31.0-rc.0~1458^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=60eaec2cc30e4fd6682c7f2aee67c12d533e3736;p=lhc%2Fweb%2Fwiklou.git Tests for TitleValue::__toString Change-Id: Ibb157b8e6e4fdc75bdb27ecaa4a552304465c4b2 --- diff --git a/tests/phpunit/includes/title/TitleValueTest.php b/tests/phpunit/includes/title/TitleValueTest.php index 4dbda74ae0..f8335549f4 100644 --- a/tests/phpunit/includes/title/TitleValueTest.php +++ b/tests/phpunit/includes/title/TitleValueTest.php @@ -116,4 +116,33 @@ class TitleValueTest extends MediaWikiTestCase { $this->assertEquals( $text, $title->getText() ); } + + public function provideTestToString() { + yield [ + new TitleValue( 0, 'Foo' ), + '0:Foo' + ]; + yield [ + new TitleValue( 1, 'Bar_Baz' ), + '1:Bar_Baz' + ]; + yield [ + new TitleValue( 9, 'JoJo', 'Frag' ), + '9:JoJo#Frag' + ]; + yield [ + new TitleValue( 200, 'tea', 'Fragment', 'wikicode' ), + 'wikicode:200:tea#Fragment' + ]; + } + + /** + * @dataProvider provideTestToString + */ + public function testToString( TitleValue $value, $expected ) { + $this->assertSame( + $expected, + $value->__toString() + ); + } }