/** * Can this title be added to a user's watchlist? * * @return bool */ public function isWatchable() { return !$this->isExternal() && MWNamespace::isWatchable($this->getNamespace()); }
public function testIsWatchable() { // Specials namespaces are not watchable $this->assertFalse(MWNamespace::isWatchable(NS_MEDIA)); $this->assertFalse(MWNamespace::isWatchable(NS_SPECIAL)); // Core defined namespaces are watchables $this->assertTrue(MWNamespace::isWatchable(NS_MAIN)); $this->assertTrue(MWNamespace::isWatchable(NS_TALK)); // Additional, user defined namespaces are watchables $this->assertTrue(MWNamespace::isWatchable(100)); $this->assertTrue(MWNamespace::isWatchable(101)); }