예제 #1
0
 public function testSetterCrashes()
 {
     $db = AetherORM::init($this->config);
     $isOk = false;
     try {
         $db->foo = 'bar';
     } catch (Exception $e) {
         $isOk = true;
     }
     $this->assertTrue($isOk);
 }
예제 #2
0
 /**
  * Fetch database instance
  *
  * @return boolean
  */
 private function getDb()
 {
     if ($this->_orm === null) {
         try {
             $this->_orm = AetherORM::init();
             $this->_db = $this->_orm->{$this->_database}->getDriver();
         } catch (AetherORMMissingConfigException $e) {
             return false;
         } catch (Exception $e) {
             throw $e;
         }
     }
     return true;
 }
예제 #3
0
 public function testSet()
 {
     $orm = AetherORM::init();
     $foos = $orm['d']->Foo("id >= 1");
     $this->assertTrue(count($foos) > 1);
 }