Esempio n. 1
0
 public function setDSN($dsn)
 {
     if (!$this->driver) {
         $this->driver = DB::singleton($dsn);
     }
 }
Esempio n. 2
0
 public function init($dsn)
 {
     ORM::registerDB('pasl_rbac', DB::factory($dsn));
 }
Esempio n. 3
0
 public function testPASLDriverGetInstance()
 {
     $dbDriver = \PASL\DB::singleton($this->strMyDsn, false, false);
     $this->assertIsA($dbDriver, 'PASL\\DB_Driver\\common');
     $this->assertIsA($dbDriver, 'PASL\\DB_Driver\\mysql');
     $dbDriverCmp = \PASL\DB::getInstance($this->aMyDsn['phptype'] . '_' . $this->aMyDsn['hostspec']);
     $this->assertIdentical($dbDriver, $dbDriverCmp);
 }
Esempio n. 4
0
 function TestAuth_mysql_bad_password()
 {
     $db = \PASL\DB::singleton($this->strMyDsn);
     $oAuth = new \PASL\Authentication('mysql');
     /**
      * @var PASL_Authentication_Provider_mysql
      */
     $authProvider = $oAuth->getProvider();
     $authProvider->setDriver($db);
     $authProvider->setEncryption('none');
     $authProvider->setQuery('SELECT * FROM `pasl_authentication_tests` WHERE `username`="%s" LIMIT 1');
     $this->assertFalse($oAuth->authenticate($this->aBadPassword));
     $oErr = $oAuth->getError();
     $this->assertEqual($oErr, PASL_AUTH_BAD_PASSWORD);
 }