Example #1
0
 public function testAddTable()
 {
     $e = null;
     try {
         $this->_conn->selectValues("SELECT * FROM reminders");
     } catch (Exception $e) {
     }
     $this->assertInstanceOf('Horde_Db_Exception', $e);
     $m = new WeNeedReminders1($this->_conn);
     $m->up();
     $this->_conn->insert("INSERT INTO reminders (content, remind_at) VALUES ('hello world', '2005-01-01 11:10:01')");
     $reminder = (object) $this->_conn->selectOne('SELECT * FROM reminders');
     $this->assertEquals('hello world', $reminder->content);
     $m->down();
     $e = null;
     try {
         $this->_conn->selectValues("SELECT * FROM reminders");
     } catch (Exception $e) {
     }
     $this->assertInstanceOf('Horde_Db_Exception', $e);
 }
Example #2
0
 public function testAddTable()
 {
     $e = null;
     try {
         $this->_conn->selectValues("SELECT * FROM reminders");
     } catch (Exception $e) {
     }
     $this->assertInstanceOf('Horde_Db_Exception', $e);
     $m = new WeNeedReminders1();
     $m->up();
     $result = Reminder::create(array('content' => 'hello world', 'remind_at' => '2005-01-01 11:10:01'));
     $this->assertInstanceOf('Reminder', $result);
     $this->assertEquals('hello world', Reminder::find('first')->content);
     $m->down();
     $e = null;
     try {
         $this->_conn->selectValues("SELECT * FROM reminders");
     } catch (Exception $e) {
     }
     $this->assertInstanceOf('Horde_Db_Exception', $e);
 }