Exemplo n.º 1
0
Arquivo: DBTest.php Projeto: 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');
 }
Exemplo n.º 2
0
Arquivo: data.php Projeto: 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;
 }