20 ->will( $this->returnValue( $id ) );
22 ->method(
'isAllowed' )
23 ->will( $this->returnValue(
true ) );
41 ->disableOriginalConstructor()
51 $this->assertSame(
$user, $item->getUser() );
52 $this->assertSame( $linkTarget, $item->getLinkTarget() );
53 $this->assertSame( $notifTimestamp, $item->getNotificationTimestamp() );
56 $this->assertInstanceOf(
'Title', $item->getTitle() );
57 $this->assertSame( $linkTarget->
getDBkey(), $item->getTitle()->getDBkey() );
58 $this->assertSame( $linkTarget->
getFragment(), $item->getTitle()->getFragment() );
59 $this->assertSame( $linkTarget->
getNamespace(), $item->getTitle()->getNamespace() );
60 $this->assertSame( $linkTarget->
getText(), $item->getTitle()->getText() );
68 $store->expects( $this->once() )
69 ->method(
'loadWatchedItem' )
70 ->with(
$user, $linkTarget )
71 ->will( $this->returnValue(
new WatchedItem(
$user, $linkTarget, $timestamp ) ) );
72 $this->
setService(
'WatchedItemStore', $store );
76 $this->assertEquals(
$user, $item->getUser() );
77 $this->assertEquals( $linkTarget, $item->getLinkTarget() );
78 $this->assertEquals( $timestamp, $item->getNotificationTimestamp() );
88 $user->expects( $this->once() )
89 ->method(
'addWatch' )
90 ->with(
$title, $checkRights );
93 $this->assertTrue( $item->addWatch() );
103 $user->expects( $this->once() )
104 ->method(
'removeWatch' )
105 ->with(
$title, $checkRights );
108 $this->assertTrue( $item->removeWatch() );
128 $user->expects( $this->once() )
129 ->method(
'isWatched' )
130 ->with(
$title, $checkRights )
131 ->will( $this->returnValue( $returnValue ) );
134 $this->assertEquals( $returnValue, $item->isWatched() );
142 $store->expects( $this->once() )
143 ->method(
'duplicateAllAssociatedEntries' )
145 $this->
setService(
'WatchedItemStore', $store );