예제 #1
0
 public function testStaticBackwardsCompatibility()
 {
     $original = PHPUnit_Framework_Error_Notice::$enabled;
     PHPUnit_Framework_Error_Notice::$enabled = false;
     ORM::for_table('widget')->find_many();
     $expected = "SELECT * FROM `widget`";
     $this->assertEquals($expected, ORM::get_last_query());
     $db = Orm::get_db();
     $this->assertTrue($db instanceof PDO);
     Orm::set_db(null);
     $db = Orm::get_db();
     $this->assertTrue($db instanceof PDO);
     $log = Orm::get_query_log();
     $this->assertTrue(is_array($log));
     $this->assertNotEmpty($log);
     Orm::configure('identifier_quote_character', null);
     Orm::_setup_identifier_quote_character();
     PHPUnit_Framework_Error_Notice::$enabled = $original;
 }