*/
public function testInLanguage() {
$this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( 'en' )->text() );
- $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() );
+ $this->assertEquals( 'Заглавная страница',
+ wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() );
// NOTE: make sure internal caching of the message text is reset appropriately
$msg = wfMessage( 'mainpage' );
$this->assertEquals( 'Main Page', $msg->inLanguage( Language::factory( 'en' ) )->text() );
- $this->assertEquals( 'Заглавная страница', $msg->inLanguage( Language::factory( 'ru' ) )->text() );
+ $this->assertEquals(
+ 'Заглавная страница',
+ $msg->inLanguage( Language::factory( 'ru' ) )->text()
+ );
}
/**
public function testMessageParams() {
$this->assertEquals( 'Return to $1.', wfMessage( 'returnto' )->text() );
$this->assertEquals( 'Return to $1.', wfMessage( 'returnto', array() )->text() );
- $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', 'foo', 'bar' )->text() );
- $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', array( 'foo', 'bar' ) )->text() );
+ $this->assertEquals(
+ 'You have foo (bar).',
+ wfMessage( 'youhavenewmessages', 'foo', 'bar' )->text()
+ );
+ $this->assertEquals(
+ 'You have foo (bar).',
+ wfMessage( 'youhavenewmessages', array( 'foo', 'bar' ) )->text()
+ );
}
/**
* @covers Message::rawParams
*/
public function testMessageParamSubstitution() {
- $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses', 'Заглавная страница' )->plain() );
- $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses', 'Заглавная страница $1' )->plain() );
- $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница' )->plain() );
- $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница $1' )->plain() );
+ $this->assertEquals(
+ '(Заглавная страница)',
+ wfMessage( 'parentheses', 'Заглавная страница' )->plain()
+ );
+ $this->assertEquals(
+ '(Заглавная страница $1)',
+ wfMessage( 'parentheses', 'Заглавная страница $1' )->plain()
+ );
+ $this->assertEquals(
+ '(Заглавная страница)',
+ wfMessage( 'parentheses' )->rawParams( 'Заглавная страница' )->plain()
+ );
+ $this->assertEquals(
+ '(Заглавная страница $1)',
+ wfMessage( 'parentheses' )->rawParams( 'Заглавная страница $1' )->plain()
+ );
}
/**
$msg = new RawMessage( '$1$2$3$4$5$6$7$8$9$10$11$12' );
// One less than above has placeholders
$params = array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k' );
- $this->assertEquals( 'abcdefghijka2', $msg->params( $params )->plain(), 'Params > 9 are replaced correctly' );
+ $this->assertEquals(
+ 'abcdefghijka2',
+ $msg->params( $params )->plain(),
+ 'Params > 9 are replaced correctly'
+ );
}
/**
// NOTE: make sure internal caching of the message text is reset appropriately.
// NOTE: wgForceUIMsgAsContentMsg forces the messages *current* language to be used.
$msg = wfMessage( 'mainpage' );
- $this->assertEquals( 'Accueil', $msg->inContentLanguage()->plain(), 'inContentLanguage() with ForceUIMsg override enabled' );
+ $this->assertEquals(
+ 'Accueil',
+ $msg->inContentLanguage()->plain(),
+ 'inContentLanguage() with ForceUIMsg override enabled'
+ );
$this->assertEquals( 'Main Page', $msg->inLanguage( 'en' )->plain(), "inLanguage( 'en' )" );
- $this->assertEquals( 'Main Page', $msg->inContentLanguage()->plain(), 'inContentLanguage() with ForceUIMsg override enabled' );
+ $this->assertEquals(
+ 'Main Page',
+ $msg->inContentLanguage()->plain(),
+ 'inContentLanguage() with ForceUIMsg override enabled'
+ );
$this->assertEquals( 'Hauptseite', $msg->inLanguage( 'de' )->plain(), "inLanguage( 'de' )" );
}