/** * @dataProvider instanceProvider * * @param DBConnectionProvider $connProvider */ public function testGetConnection(DBConnectionProvider $connProvider) { $connection = $connProvider->getConnection(); $this->assertInstanceOf('DatabaseBase', $connection); $this->assertTrue($connection === $connProvider->getConnection()); $connProvider->releaseConnection(); $this->assertInstanceOf('DatabaseBase', $connProvider->getConnection()); }
/** * @since 1.0 * * @param Title $title * * @return array */ private function getConditions(Title $title) { /** * @var \DatabaseBase $dbr */ $dbr = $this->connectionProvider->getConnection(); $conditions = array('page_namespace' => $title->getNamespace(), 'page_title' . $dbr->buildLike($title->getDBkey() . '/', $dbr->anyString())); if (!$this->options[self::OPT_INCLUDE_REDIRECTS]) { $conditions['page_is_redirect'] = 0; } return $conditions; }