public function testAddRedirectInfoRecordToFetchFromCache() { $connection = $this->getMockBuilder('\\SMW\\MediaWiki\\Database')->disableOriginalConstructor()->getMock(); $connection->expects($this->once())->method('insert')->with($this->anything(), $this->equalTo(array('s_title' => 'Foo', 's_namespace' => 0, 'o_id' => 42))); $instance = new RedirectInfoStore($connection, $this->cache); $instance->addRedirectForId(42, 'Foo', 0); $this->assertEquals(42, $instance->findRedirectIdFor('Foo', 0)); }
/** * @see RedirectInfoStore::addRedirectForId * * @since 2.1 * * @param integer $id * @param string $title * @param integer $namespace */ public function addRedirectForId($id, $title, $namespace) { return $this->redirectInfoStore->addRedirectForId($id, $title, $namespace); }