diff --git a/ext/pdo_dblib/tests/common.phpt b/ext/pdo_dblib/tests/common.phpt index cbc2ac530c8..1a1e34bc761 100644 --- a/ext/pdo_dblib/tests/common.phpt +++ b/ext/pdo_dblib/tests/common.phpt @@ -2,8 +2,7 @@ DBLIB --SKIPIF-- +if (!extension_loaded('pdo_dblib')) print 'skip'; ?> --REDIRECTTEST-- # magic auto-configuration # Also update config.inc if you make changes here... diff --git a/ext/pdo_dblib/tests/pdo_dblib.phpt b/ext/pdo_dblib/tests/pdo_dblib.phpt deleted file mode 100644 index 150e39cfb96..00000000000 --- a/ext/pdo_dblib/tests/pdo_dblib.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -PDO_DBLIB: Core tests ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); -$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); - -test_transaction(); -test_quotedident(); -test_prepare(); - -function test_quotedident() { - global $db; - $db->query('CREATE TABLE "Test Table" ("My Field" int, "Another Field" varchar(32) not null default \'test_string\')'); - $db->query('INSERT INTO "Test Table" ("My Field") values(1)'); - $db->query('INSERT INTO "Test Table" ("My Field") values(2)'); - $db->query('INSERT INTO "Test Table" ("My Field") values(3)'); - $rs = $db->query('SELECT * FROM "Test Table"'); - var_dump($rs->fetchAll(PDO::FETCH_ASSOC)); - $db->query('DROP TABLE "Test Table"'); -} - -function test_transaction() { - global $db; - echo "Transactions\n"; - - /*We see these rows */ - $db->query("CREATE table php_test(val int)"); - $db->beginTransaction(); - $db->query("INSERT INTO php_test(val) values(1)"); - $db->query("INSERT INTO php_test(val) values(2)"); - $db->query("INSERT INTO php_test(val) values(3)"); - $db->query("INSERT INTO php_test(val) values(4)"); - $db->commit(); - - /*We don't see these rows */ - $db->beginTransaction(); - $db->query("INSERT INTO php_test(val) values(5)"); - $db->query("INSERT INTO php_test(val) values(6)"); - $db->query("INSERT INTO php_test(val) values(7)"); - $db->query("INSERT INTO php_test(val) values(8)"); - $db->rollback(); - - $rs = $db->query("SELECT * FROM php_test"); - $rows = $rs->fetchAll(PDO::FETCH_ASSOC); - var_dump($rows); - - $db->query("DROP table php_test"); - -} - -$db = null; - -function test_prepare() { - global $db; - echo "Prepare:\n"; - $stmt = $db->prepare("select ic1.* - from information_schema.columns ic1 - cross join information_schema.columns ic2 - cross join information_schema.columns ic3"); - - echo "Execute:\n"; - $x = $stmt->execute(); - - echo "Fetch\n"; - $n = 0; - $mem = 0; - while (($r = $stmt->fetch())) { - if ($n ==0) - $mem = memory_get_usage(); - if ($n % 1000 == 0) { - echo($mem - memory_get_usage()); - } - $n++; - - } - $stmt = null; -} - -echo "All done\n"; -?> ---EXPECT--