示例#1
0
 /**
  * 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;
 }
示例#2
0
 /**
  * Test successful login.
  *
  * @return void
  */
 public function testLogin()
 {
     $user = $this->auth->authenticate($this->getLoginRequest());
     $this->assertEquals('testuser', $user->username);
     $this->assertEquals('*****@*****.**', $user->email);
 }