return $logEntry;
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ */
public function testNormalLogParams() {
$entry = $this->newLogEntry( 'test', array() );
$formatter = LogFormatter::newFromEntry( $entry );
$this->assertEquals( $titleLink, $paramsWithoutTools[2]['raw'] );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeRaw() {
$params = array( '4:raw:raw' => Linker::link( $this->title, null, array(), array() ) );
$expected = Linker::link( $this->title, null, array(), array() );
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeMsg() {
$params = array( '4:msg:msg' => 'log-description-phpunit' );
$expected = wfMessage( 'log-description-phpunit' )->text();
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeMsgContent() {
$params = array( '4:msg-content:msgContent' => 'log-description-phpunit' );
$expected = wfMessage( 'log-description-phpunit' )->inContentLanguage()->text();
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeNumber() {
global $wgLang;
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeUserLink() {
$params = array( '4:user-link:userLink' => $this->user->getName() );
$expected = Linker::userLink(
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeTitleLink() {
$params = array( '4:title-link:titleLink' => $this->title->getText() );
$expected = Linker::link( $this->title, null, array(), array() );
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypePlain() {
$params = array( '4:plain:plain' => 'Some plain text' );
$expected = 'Some plain text';
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getComment
+ */
public function testLogComment() {
$entry = $this->newLogEntry( 'test', array() );
$formatter = LogFormatter::newFromEntry( $entry );