Beispiel #1
0
 public function testTransactionWrapper()
 {
     $this->db->transaction(function () {
         $this->db->query("INSERT INTO test (id, code, price) VALUES (3003, '1', 1)");
         $this->db->query("INSERT INTO test (id, code, price) VALUES (3004, '1', 1)");
     });
     $col = $this->db->getColumn('SELECT id FROM test WHERE id IN (3003, 3004)');
     $this->assertEquals([3003, 3004], $col);
 }
Beispiel #2
0
 public function testGetColumn()
 {
     $res = $this->db->getColumn('SELECT code FROM test WHERE id IN (1, 2)');
     $expect = ['001', '002'];
     $this->assertEquals($expect, $res);
 }