<?php
+
/**
* @covers RCCacheEntryFactory
*
* @author Katie Filbert < aude.wiki@gmail.com >
*/
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
-
protected function setUp() {
parent::setUp();
/**
* @dataProvider editChangeProvider
*/
- public function testNewFromRecentChange( $expected, $context, $messages, $recentChange, $watched ) {
+ public function testNewFromRecentChange( $expected, $context, $messages,
+ $recentChange, $watched
+ ) {
$cacheEntryFactory = new RCCacheEntryFactory( $context, $messages );
$cacheEntry = $cacheEntryFactory->newFromRecentChange( $recentChange, $watched );
$this->assertEquals( $watched, $cacheEntry->watched, 'watched' );
$this->assertEquals( $expected['timestamp'], $cacheEntry->timestamp, 'timestamp' );
- $this->assertEquals( $expected['numberofWatchingusers'], $cacheEntry->numberofWatchingusers, 'watching users' );
+ $this->assertEquals(
+ $expected['numberofWatchingusers'], $cacheEntry->numberofWatchingusers,
+ 'watching users'
+ );
$this->assertEquals( $expected['unpatrolled'], $cacheEntry->unpatrolled, 'unpatrolled' );
$this->assertUserLinks( 'Mary', $cacheEntry );
$this->assertEquals( $watched, $cacheEntry->watched, 'watched' );
$this->assertEquals( $expected['timestamp'], $cacheEntry->timestamp, 'timestamp' );
- $this->assertEquals( $expected['numberofWatchingusers'], $cacheEntry->numberofWatchingusers, 'watching users' );
+ $this->assertEquals(
+ $expected['numberofWatchingusers'],
+ $cacheEntry->numberofWatchingusers, 'watching users'
+ );
$this->assertEquals( $expected['unpatrolled'], $cacheEntry->unpatrolled, 'unpatrolled' );
$this->assertDeleteLogLink( $cacheEntry );
$this->assertEquals( $watched, $cacheEntry->watched, 'watched' );
$this->assertEquals( $expected['timestamp'], $cacheEntry->timestamp, 'timestamp' );
- $this->assertEquals( $expected['numberofWatchingusers'], $cacheEntry->numberofWatchingusers, 'watching users' );
+ $this->assertEquals(
+ $expected['numberofWatchingusers'],
+ $cacheEntry->numberofWatchingusers, 'watching users'
+ );
$this->assertEquals( $expected['unpatrolled'], $cacheEntry->unpatrolled, 'unpatrolled' );
$this->assertRevDel( $cacheEntry );
'assert query link element'
);
- foreach( $params as $key => $value ) {
+ foreach ( $params as $key => $value ) {
$this->assertRegExp( '/' . $key . '=' . $value . '/', $link, "verify $key link params" );
}
}
private function getTestUser() {
$user = User::newFromName( 'Mary' );
- if ( ! $user->getId() ) {
+ if ( !$user->getId() ) {
$user->addToDatabase();
}
return $context;
}
-
}
<?php
+
/**
* @group Database
*/
# move/move
$this->assertIRCComment(
- $this->context->msg( '1movedto2', 'SomeTitle', 'TestTarget' )->plain() . $sep . $this->user_comment,
+ $this->context->msg( '1movedto2', 'SomeTitle', 'TestTarget' )
+ ->plain() . $sep . $this->user_comment,
'move', 'move',
$move_params,
$this->user_comment
# move/move_redir
$this->assertIRCComment(
- $this->context->msg( '1movedto2_redir', 'SomeTitle', 'TestTarget' )->plain() . $sep . $this->user_comment,
+ $this->context->msg( '1movedto2_redir', 'SomeTitle', 'TestTarget' )
+ ->plain() . $sep . $this->user_comment,
'move', 'move_redir',
$move_params,
$this->user_comment
# protect/protect
$this->assertIRCComment(
- $this->context->msg( 'protectedarticle', 'SomeTitle ' . $protectParams[0] )->plain() . $sep . $this->user_comment,
+ $this->context->msg( 'protectedarticle', 'SomeTitle ' . $protectParams[0] )
+ ->plain() . $sep . $this->user_comment,
'protect', 'protect',
$protectParams,
$this->user_comment
# protect/modify
$this->assertIRCComment(
- $this->context->msg( 'modifiedarticleprotection', 'SomeTitle ' . $protectParams[0] )->plain() . $sep . $this->user_comment,
+ $this->context->msg( 'modifiedarticleprotection', 'SomeTitle ' . $protectParams[0] )
+ ->plain() . $sep . $this->user_comment,
'protect', 'modify',
$protectParams,
$this->user_comment
* @param $comment String (optional) A comment for the log action
* @param $msg String (optional) A message for PHPUnit :-)
*/
- protected function assertIRCComment( $expected, $type, $action, $params, $comment = null, $msg = '' ) {
-
+ protected function assertIRCComment( $expected, $type, $action, $params,
+ $comment = null, $msg = ''
+ ) {
$logEntry = new ManualLogEntry( $type, $action );
$logEntry->setPerformer( $this->user );
$logEntry->setTarget( $this->title );