示例#1
0
文件: DBTest.php 项目: jasny/Q
 /**
  * Test Authenticator_DB::onLogout()
  */
 public function testOnLogout()
 {
     $this->Auth->loginRequired = false;
     $this->Auth->login('monkey', 'mark');
     $this->Auth->logout();
     list($id, $username, $fullname) = $this->conn->query("SELECT @auth_uid, @auth_username, @auth_fullname")->fetchRow();
     $this->assertNull($id, 'id');
     $this->assertNull($username, 'username');
     $this->assertNull($fullname, 'fullname');
 }
示例#2
0
文件: data.php 项目: jasny/Q
 /**
  * Delete a record.
  * 
  * @param string  $table   Use a different table
  * @param mixed   $id
  */
 public function delete($table = null, $id = null)
 {
     if (empty($table) && !$this->td) {
         throw new Exception("No table argument specified");
     }
     $td = empty($table) ? $this->td : ($table instanceof DB_Table ? $table : DB::i()->table($table));
     if (!isset($id) && isset($_GET['id'])) {
         $id = $_GET['id'];
     }
     if (!isset($id)) {
         throw new Exception("No id argument specified");
     }
     $td->delete($id, DB::SINGLE_ROW);
     echo 1;
 }