dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Defer cookie block checks to resolve a circular dependency
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
watcheditem
/
NoWriteWatchedItemStoreUnitTest.php
diff --git
a/tests/phpunit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php
b/tests/phpunit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php
index
a8761e3
..
f424b21
100644
(file)
--- a/
tests/phpunit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php
+++ b/
tests/phpunit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php
@@
-1,5
+1,7
@@
<?php
<?php
+use MediaWiki\User\UserIdentityValue;
+
/**
* @author Addshore
*
/**
* @author Addshore
*
@@
-14,7
+16,8
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$this->setExpectedException( DBReadOnlyError::class );
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$this->setExpectedException( DBReadOnlyError::class );
- $noWriteService->addWatch( $this->getTestSysop()->getUser(), new TitleValue( 0, 'Foo' ) );
+ $noWriteService->addWatch(
+ new UserIdentityValue( 1, 'MockUser', 0 ), new TitleValue( 0, 'Foo' ) );
}
public function testAddWatchBatchForUser() {
}
public function testAddWatchBatchForUser() {
@@
-24,7
+27,7
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$this->setExpectedException( DBReadOnlyError::class );
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$this->setExpectedException( DBReadOnlyError::class );
- $noWriteService->addWatchBatchForUser(
$this->getTestSysop()->getUser(
), [] );
+ $noWriteService->addWatchBatchForUser(
new UserIdentityValue( 1, 'MockUser', 0
), [] );
}
public function testRemoveWatch() {
}
public function testRemoveWatch() {
@@
-34,7
+37,8
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$this->setExpectedException( DBReadOnlyError::class );
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$this->setExpectedException( DBReadOnlyError::class );
- $noWriteService->removeWatch( $this->getTestSysop()->getUser(), new TitleValue( 0, 'Foo' ) );
+ $noWriteService->removeWatch(
+ new UserIdentityValue( 1, 'MockUser', 0 ), new TitleValue( 0, 'Foo' ) );
}
public function testSetNotificationTimestampsForUser() {
}
public function testSetNotificationTimestampsForUser() {
@@
-45,7
+49,7
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$this->setExpectedException( DBReadOnlyError::class );
$noWriteService->setNotificationTimestampsForUser(
$this->setExpectedException( DBReadOnlyError::class );
$noWriteService->setNotificationTimestampsForUser(
-
$this->getTestSysop()->getUser(
),
+
new UserIdentityValue( 1, 'MockUser', 0
),
'timestamp',
[]
);
'timestamp',
[]
);
@@
-59,7
+63,7
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$this->setExpectedException( DBReadOnlyError::class );
$noWriteService->updateNotificationTimestamp(
$this->setExpectedException( DBReadOnlyError::class );
$noWriteService->updateNotificationTimestamp(
-
$this->getTestSysop()->getUser(
),
+
new UserIdentityValue( 1, 'MockUser', 0
),
new TitleValue( 0, 'Foo' ),
'timestamp'
);
new TitleValue( 0, 'Foo' ),
'timestamp'
);
@@
-73,8
+77,8
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$this->setExpectedException( DBReadOnlyError::class );
$noWriteService->resetNotificationTimestamp(
$this->setExpectedException( DBReadOnlyError::class );
$noWriteService->resetNotificationTimestamp(
-
$this->getTestSysop()->getUser(
),
-
Title::newFromText(
'Foo' )
+
new UserIdentityValue( 1, 'MockUser', 0
),
+
new TitleValue( 0,
'Foo' )
);
}
);
}
@@
-85,7
+89,7
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->countWatchedItems(
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->countWatchedItems(
-
$this->getTestSysop()->getUser(
)
+
new UserIdentityValue( 1, 'MockUser', 0
)
);
$this->assertEquals( __METHOD__, $return );
}
);
$this->assertEquals( __METHOD__, $return );
}
@@
-154,7
+158,7
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->getWatchedItem(
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->getWatchedItem(
-
$this->getTestSysop()->getUser(
),
+
new UserIdentityValue( 1, 'MockUser', 0
),
new TitleValue( 0, 'Foo' )
);
$this->assertEquals( __METHOD__, $return );
new TitleValue( 0, 'Foo' )
);
$this->assertEquals( __METHOD__, $return );
@@
-167,7
+171,7
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->loadWatchedItem(
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->loadWatchedItem(
-
$this->getTestSysop()->getUser(
),
+
new UserIdentityValue( 1, 'MockUser', 0
),
new TitleValue( 0, 'Foo' )
);
$this->assertEquals( __METHOD__, $return );
new TitleValue( 0, 'Foo' )
);
$this->assertEquals( __METHOD__, $return );
@@
-182,7
+186,7
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->getWatchedItemsForUser(
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->getWatchedItemsForUser(
-
$this->getTestSysop()->getUser(
),
+
new UserIdentityValue( 1, 'MockUser', 0
),
[]
);
$this->assertEquals( __METHOD__, $return );
[]
);
$this->assertEquals( __METHOD__, $return );
@@
-195,7
+199,7
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->isWatched(
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->isWatched(
-
$this->getTestSysop()->getUser(
),
+
new UserIdentityValue( 1, 'MockUser', 0
),
new TitleValue( 0, 'Foo' )
);
$this->assertEquals( __METHOD__, $return );
new TitleValue( 0, 'Foo' )
);
$this->assertEquals( __METHOD__, $return );
@@
-210,7
+214,7
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->getNotificationTimestampsBatch(
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->getNotificationTimestampsBatch(
-
$this->getTestSysop()->getUser(
),
+
new UserIdentityValue( 1, 'MockUser', 0
),
[ new TitleValue( 0, 'Foo' ) ]
);
$this->assertEquals( __METHOD__, $return );
[ new TitleValue( 0, 'Foo' ) ]
);
$this->assertEquals( __METHOD__, $return );
@@
-225,7
+229,7
@@
class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->countUnreadNotifications(
$noWriteService = new NoWriteWatchedItemStore( $innerService );
$return = $noWriteService->countUnreadNotifications(
-
$this->getTestSysop()->getUser(
),
+
new UserIdentityValue( 1, 'MockUser', 0
),
88
);
$this->assertEquals( __METHOD__, $return );
88
);
$this->assertEquals( __METHOD__, $return );