Example #1
0
 public function testSelectOne()
 {
     $result = DB::selectOne("SELECT * FROM `posts` limit 1;");
     $this->assertEquals('posts', array_shift(array_keys($result)));
     $this->assertEquals('id', array_shift(array_keys(array_shift($result))));
     $result = DB::selectOne("SELECT * FROM `posts` WHERE slug like 'm%' limit 1;");
     $this->assertEquals(array(), $result);
     $this->setExpectedException('MindaPHP\\DBError');
     $result = DB::selectOne("some bogus query;");
 }