Exemplo n.º 1
0
 private function quotesTestSupport(MysqltcsOperations $connection)
 {
     $db = (require __DIR__ . "/config.php");
     $connection->getList("*", "1");
     $connection->getList("*", "1", "id", $db['tables']['test1'], true);
     $connection->getList("*", "1", "id", "`" . $db['tables']['test1'] . "`", false);
 }
Exemplo n.º 2
0
 private function simpleChain()
 {
     $db = (require __DIR__ . "/config.php");
     $expected = array();
     self::$connection->insert($db['tables']['test1'] . ".value", "'test1'");
     $expected[] = array("id" => self::$connection->getLastId(), "value" => "test1");
     self::$connection->insert($db['tables']['test1'] . ".value", "'test2'");
     $id = self::$connection->getLastId();
     self::$connection->update(array($db['tables']['test1'] . ".value" => "'test3'"), $db['tables']['test1'] . ".id = " . $id);
     $expected[] = array("id" => $id, "value" => "test3");
     $this->assertEquals($expected, self::$connection->getList($db['tables']['test1'] . ".id, " . $db['tables']['test1'] . ".value", "1", "id ASC"));
     $this->assertNotEquals($expected, self::$connection->getList($db['tables']['test1'] . ".id, " . $db['tables']['test1'] . ".value", "1", "id DESC"));
     foreach ($expected as $row) {
         self::$connection->deleteRows($db['tables']['test1'] . ".id = " . $row['id']);
     }
     $this->assertEquals(array(), self::$connection->getList("*", "1"));
 }