/** * @return DB */ public static function getNewDb() { $db = new DB('mysql:dbname=harp-orm/query;host=127.0.0.1', 'root'); $db->setEscaping(DB::ESCAPING_MYSQL); $db->setLogger(new TestLogger()); return $db; }
/** * @covers ::setEscaping * @covers ::getEscaping */ public function testEscaping() { $db = new DB(); $this->assertEquals(DB::ESCAPING_MYSQL, $db->getEscaping()); $db->setEscaping(DB::ESCAPING_STANDARD); $this->assertEquals(DB::ESCAPING_STANDARD, $db->getEscaping()); $this->setExpectedException('InvalidArgumentException', 'Escaping can be DB::ESCAPING_MYSQL, DB::ESCAPING_STANDARD or DB::ESCAPING_NONE'); $db->setEscaping('asd'); }
public function tearDown() { DB::get()->rollback(); parent::tearDown(); }
/** * @return DB */ public function getDbInstance() { return DB::get($this->getDb()); }