/** * Get a handler w/ fake table manager. * * @param object $table Mock table. * * @return Database */ protected function getDatabase($table) { $tableManager = $this->getMock('VuFind\\Db\\Table\\PluginManager', ['get']); $tableManager->expects($this->once())->method('get')->with($this->equalTo('User'))->will($this->returnValue($table)); $db = new Database(); $db->setDbTableManager($tableManager); return $db; }
/** * Test successful login. * * @return void */ public function testLogin() { $user = $this->auth->authenticate($this->getLoginRequest()); $this->assertEquals('testuser', $user->username); $this->assertEquals('*****@*****.**', $user->email); }