31 ->will( $this->returnValue( $id ) );
33 ->method(
'isAllowed' )
34 ->will( $this->returnValue(
true ) );
52 ->disableOriginalConstructor()
62 $this->assertSame(
$user, $item->getUser() );
63 $this->assertSame( $linkTarget, $item->getLinkTarget() );
64 $this->assertSame( $notifTimestamp, $item->getNotificationTimestamp() );
67 $this->assertInstanceOf(
'Title', $item->getTitle() );
68 $this->assertSame( $linkTarget->
getDBkey(), $item->getTitle()->getDBkey() );
69 $this->assertSame( $linkTarget->
getFragment(), $item->getTitle()->getFragment() );
70 $this->assertSame( $linkTarget->
getNamespace(), $item->getTitle()->getNamespace() );
71 $this->assertSame( $linkTarget->
getText(), $item->getTitle()->getText() );
79 $store->expects( $this->once() )
80 ->method(
'loadWatchedItem' )
81 ->with(
$user, $linkTarget )
82 ->will( $this->returnValue(
new WatchedItem(
$user, $linkTarget, $timestamp ) ) );
83 $this->
setService(
'WatchedItemStore', $store );
87 $this->assertEquals(
$user, $item->getUser() );
88 $this->assertEquals( $linkTarget, $item->getLinkTarget() );
89 $this->assertEquals( $timestamp, $item->getNotificationTimestamp() );
99 $user->expects( $this->once() )
100 ->method(
'addWatch' )
101 ->with(
$title, $checkRights );
104 $this->assertTrue( $item->addWatch() );
114 $user->expects( $this->once() )
115 ->method(
'removeWatch' )
116 ->with(
$title, $checkRights );
119 $this->assertTrue( $item->removeWatch() );
139 $user->expects( $this->once() )
140 ->method(
'isWatched' )
141 ->with(
$title, $checkRights )
142 ->will( $this->returnValue( $returnValue ) );
145 $this->assertEquals( $returnValue, $item->isWatched() );
153 $store->expects( $this->once() )
154 ->method(
'duplicateAllAssociatedEntries' )
156 $this->
setService(
'WatchedItemStore', $store );