public function testSelect() { $data = $this->db->select('SELECT * FROM test_users'); $this->assertEquals(3, count($data)); $row = $this->db->selectRow('SELECT * FROM test_users WHERE id=1'); $this->assertEquals(1, $row['id']); $this->assertEquals('user1', $row['username']); $this->assertEquals('pass', $row['password']); $count = $this->db->selectValue('SELECT COUNT(*) FROM test_users'); $this->assertEquals(3, $count); }
public function selectList($where) { return Utils::map($this->db->select("SELECT * FROM {$this->table} WHERE {$where}"), $this->class); }
/** * @expectedException \Vtk13\LibSql\SqlException * @expectedExceptionMessage You have an error in your SQL syntax; */ public function testMisspelledSelect() { $this->db->select('S E'); }