Skip to content

Commit eb9955d

Browse files
committed
Address review comments
1 parent e69e7fa commit eb9955d

File tree

88 files changed

+142
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+142
-204
lines changed

ext/pdo/tests/bug_34630.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var_dump($db->query("SELECT * from test34630")->fetchAll(PDO::FETCH_ASSOC));
5050
<?php
5151
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
5252
$db = PDOTest::factory();
53-
$db->exec("DROP TABLE test34630");
53+
PDOTest::dropTableIfExists($db, "test34630");
5454
?>
5555
--EXPECT--
5656
array(1) {

ext/pdo/tests/bug_35671.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var_dump($db->query("SELECT * from test35671")->fetchAll(PDO::FETCH_ASSOC));
3636
<?php
3737
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3838
$db = PDOTest::factory();
39-
$db->exec("DROP TABLE test35671");
39+
PDOTest::dropTableIfExists($db, "test35671");
4040
?>
4141
--EXPECT--
4242
array(1) {

ext/pdo/tests/bug_36428.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var_dump($res->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_PROPS_LATE, 'SimpleXMLElemen
2626
<?php
2727
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
2828
$db = PDOTest::factory();
29-
$db->exec("DROP TABLE test36428");
29+
PDOTest::dropTableIfExists($db, "test36428");
3030
?>
3131
--EXPECTF--
3232
array(1) {

ext/pdo/tests/bug_36798.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $db = PDOTest::factory();
2929
$db->exec("CREATE TABLE test36798 (id INTEGER)");
3030
$db->exec("INSERT INTO test36798 (id) VALUES (1)");
3131

32-
$stmt = $db->prepare("SELECT '' as test FROM test36798 WHERE id = :id");
32+
$stmt = $db->prepare("SELECT 'Ã' as test FROM test36798 WHERE id = :id");
3333
$stmt->execute(array(":id" => 1));
3434

3535
$row = $stmt->fetch(PDO::FETCH_NUM);
@@ -40,7 +40,7 @@ var_dump( $row );
4040
<?php
4141
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4242
$db = PDOTest::factory();
43-
$db->exec("DROP TABLE test36798");
43+
PDOTest::dropTableIfExists($db, "test36798");
4444
?>
4545
--EXPECT--
4646
array(1) {

ext/pdo/tests/bug_38253.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var_dump($stmt->fetchAll());
3333
<?php
3434
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3535
$db = PDOTest::factory();
36-
$db->exec("DROP TABLE test38253");
36+
PDOTest::dropTableIfExists($db, "test38253");
3737
?>
3838
--EXPECTF--
3939
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch class specified in %s on line %d

ext/pdo/tests/bug_38394.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var_dump($db->query("SELECT * FROM test38394")->fetchAll(PDO::FETCH_ASSOC));
3131
<?php
3232
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3333
$db = PDOTest::factory();
34-
$db->exec("DROP TABLE test38394");
34+
PDOTest::dropTableIfExists($db, "test38394");
3535
?>
3636
--EXPECT--
3737
array(2) {

ext/pdo/tests/bug_39398.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var_dump($db->query("SELECT * FROM test39398")->fetchAll(PDO::FETCH_ASSOC));
2828
<?php
2929
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3030
$db = PDOTest::factory();
31-
$db->exec("DROP TABLE test39398");
31+
PDOTest::dropTableIfExists($db, "test39398");
3232
?>
3333
--EXPECT--
3434
array(1) {

ext/pdo/tests/bug_39656.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ echo "Done\n";
3838
<?php
3939
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4040
$db = PDOTest::factory();
41-
$db->exec("DROP TABLE test39656");
41+
PDOTest::dropTableIfExists($db, "test39656");
4242
?>
4343
--EXPECT--
4444
array(4) {

ext/pdo/tests/bug_40285.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ echo "Done\n";
2828
<?php
2929
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3030
$db = PDOTest::factory();
31-
$db->exec("DROP TABLE test40285");
31+
PDOTest::dropTableIfExists($db, "test40285");
3232
?>
3333
--EXPECT--
3434
Done

ext/pdo/tests/bug_42917.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var_dump($res->fetchAll());
3030
<?php
3131
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3232
$db = PDOTest::factory();
33-
$db->exec("DROP TABLE test42917");
33+
PDOTest::dropTableIfExists($db, "test42917");
3434
?>
3535
--EXPECT--
3636
array(5) {

ext/pdo/tests/bug_43130.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var_dump($stmt->fetch(PDO::FETCH_COLUMN));
3939
<?php
4040
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4141
$db = PDOTest::factory();
42-
$db->exec("DROP TABLE test43130");
42+
PDOTest::dropTableIfExists($db, "test43130");
4343
?>
4444
--EXPECTF--
4545
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in %s on line %d

ext/pdo/tests/bug_44173.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ try {
7676
<?php
7777
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
7878
$db = PDOTest::factory();
79-
$db->exec("DROP TABLE test44173");
79+
PDOTest::dropTableIfExists($db, "test44173");
8080
?>
8181
--EXPECT--
8282
PDO::query() expects exactly 2 arguments for the fetch mode provided, 4 given

ext/pdo/tests/bug_44409.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ print_r($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE, "bug44409"));
4545
<?php
4646
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4747
$db = PDOTest::factory();
48-
$db->exec("DROP TABLE test44409");
48+
PDOTest::dropTableIfExists($db, "test44409");
4949
?>
5050
--EXPECTF--
5151
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d

ext/pdo/tests/bug_50458.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var_dump($res->fetchAll(PDO::FETCH_FUNC, function($a) { return strtoupper($a); }
2525
<?php
2626
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
2727
$db = PDOTest::factory();
28-
$db->exec("DROP TABLE test50458");
28+
PDOTest::dropTableIfExists($db, "test50458");
2929
?>
3030
--EXPECT--
3131
array(1) {

ext/pdo/tests/bug_52098.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ echo $obj->lucky();
5353
<?php
5454
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
5555
$db = PDOTest::factory();
56-
$db->exec("DROP TABLE test52098");
56+
PDOTest::dropTableIfExists($db, "test52098");
5757
?>
5858
--EXPECT--
5959
Calling object method 'foo'

ext/pdo/tests/bug_64172.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var_dump($db->errorInfo());
4747
<?php
4848
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4949
$db = PDOTest::factory();
50-
$db->exec("DROP TABLE test64172");
50+
PDOTest::dropTableIfExists($db, "test64172");
5151
?>
5252
--EXPECTF--
5353
===FAIL===

ext/pdo/tests/bug_65946.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
4545
<?php
4646
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4747
$db = PDOTest::factory();
48-
$db->exec("DROP TABLE test65946");
48+
PDOTest::dropTableIfExists($db, "test65946");
4949
?>
5050
--EXPECT--
5151
array(1) {

ext/pdo/tests/bug_71447.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ var_dump($stmt->fetchColumn());
9999
<?php
100100
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
101101
$db = PDOTest::factory();
102-
$db->exec("DROP TABLE test71447");
102+
PDOTest::dropTableIfExists($db, "test71447");
103103
?>
104104
--EXPECT--
105105
string(10) ""abc":8000"

ext/pdo/tests/bug_71885.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ try {
5252
<?php
5353
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
5454
$db = PDOTest::factory();
55-
$db->exec("DROP TABLE test71885");
55+
PDOTest::dropTableIfExists($db, "test71885");
5656
?>
5757
--EXPECT--
5858
bool(true)

ext/pdo/tests/bug_73234.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
4848
<?php
4949
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
5050
$db = PDOTest::factory();
51-
$db->exec("DROP TABLE test73234");
51+
PDOTest::dropTableIfExists($db, "test73234");
5252
?>
5353
--EXPECT--
5454
array(2) {

ext/pdo/tests/gh8626.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
2121
$db = PDOTest::factory();
2222
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
2323

24-
$db->exec('DROP TABLE test8626');
2524
$db->exec('CREATE TABLE test8626 (x int NOT NULL)');
2625

2726
$stmt = $db->prepare('INSERT INTO test8626 VALUES(?)');
@@ -43,7 +42,7 @@ var_dump(array_slice($errorInfo, 0, 3)); // odbc, dblib
4342
<?php
4443
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4544
$db = PDOTest::factory();
46-
$db->exec("DROP TABLE test8626");
45+
PDOTest::dropTableIfExists($db, "test8626");
4746
?>
4847
--EXPECTF--
4948
bool(false)

ext/pdo/tests/pdo_001.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
1616
$db = PDOTest::factory();
1717

1818
$db->exec('CREATE TABLE test001(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
19-
$db->exec("INSERT INTO test001 VALUES(1, 'A')");
20-
$db->exec("INSERT INTO test001 VALUES(2, 'B')");
21-
$db->exec("INSERT INTO test001 VALUES(3, 'C')");
19+
$db->exec("INSERT INTO test001 VALUES(1, 'A'), (2, 'B'), (3, 'C')");
2220

2321
$stmt = $db->prepare('SELECT * from test001');
2422
$stmt->execute();
@@ -29,7 +27,7 @@ var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
2927
<?php
3028
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3129
$db = PDOTest::factory();
32-
$db->exec("DROP TABLE test001");
30+
PDOTest::dropTableIfExists($db, "test001");
3331
?>
3432
--EXPECT--
3533
array(3) {

ext/pdo/tests/pdo_002.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
1616
$db = PDOTest::factory();
1717

1818
$db->exec('CREATE TABLE test002(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
19-
$db->exec("INSERT INTO test002 VALUES(1, 'A')");
20-
$db->exec("INSERT INTO test002 VALUES(2, 'B')");
21-
$db->exec("INSERT INTO test002 VALUES(3, 'C')");
19+
$db->exec("INSERT INTO test002 VALUES(1, 'A'), (2, 'B'), (3, 'C')");
2220

2321
$stmt = $db->prepare('SELECT * from test002');
2422
$stmt->execute();
@@ -29,7 +27,7 @@ var_dump($stmt->fetchAll(PDO::FETCH_NUM));
2927
<?php
3028
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3129
$db = PDOTest::factory();
32-
$db->exec("DROP TABLE test002");
30+
PDOTest::dropTableIfExists($db, "test002");
3331
?>
3432
--EXPECT--
3533
array(3) {

ext/pdo/tests/pdo_003.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
1616
$db = PDOTest::factory();
1717

1818
$db->exec('CREATE TABLE test003(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
19-
$db->exec("INSERT INTO test003 VALUES(1, 'A')");
20-
$db->exec("INSERT INTO test003 VALUES(2, 'B')");
21-
$db->exec("INSERT INTO test003 VALUES(3, 'C')");
19+
$db->exec("INSERT INTO test003 VALUES(1, 'A'), (2, 'B'), (3, 'C')");
2220

2321
$stmt = $db->prepare('SELECT * from test003');
2422
$stmt->execute();
@@ -29,7 +27,7 @@ var_dump($stmt->fetchAll(PDO::FETCH_BOTH));
2927
<?php
3028
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3129
$db = PDOTest::factory();
32-
$db->exec("DROP TABLE test003");
30+
PDOTest::dropTableIfExists($db, "test003");
3331
?>
3432
--EXPECT--
3533
array(3) {

ext/pdo/tests/pdo_004.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
1616
$db = PDOTest::factory();
1717

1818
$db->exec('CREATE TABLE test004(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
19-
$db->exec("INSERT INTO test004 VALUES(1, 'A')");
20-
$db->exec("INSERT INTO test004 VALUES(2, 'B')");
21-
$db->exec("INSERT INTO test004 VALUES(3, 'C')");
19+
$db->exec("INSERT INTO test004 VALUES(1, 'A'), (2, 'B'), (3, 'C')");
2220

2321
$stmt = $db->prepare('SELECT * from test004');
2422
$stmt->execute();
@@ -29,7 +27,7 @@ var_dump($stmt->fetchAll(PDO::FETCH_OBJ));
2927
<?php
3028
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3129
$db = PDOTest::factory();
32-
$db->exec("DROP TABLE test004");
30+
PDOTest::dropTableIfExists($db, "test004");
3331
?>
3432
--EXPECTF--
3533
array(3) {

ext/pdo/tests/pdo_005.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
1616
$db = PDOTest::factory();
1717

1818
$db->exec('CREATE TABLE test005(id int NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(10))');
19-
$db->exec("INSERT INTO test005 VALUES(1, 'A', 'AA')");
20-
$db->exec("INSERT INTO test005 VALUES(2, 'B', 'BB')");
21-
$db->exec("INSERT INTO test005 VALUES(3, 'C', 'CC')");
19+
$db->exec("INSERT INTO test005 VALUES(1, 'A', 'AA'), (2, 'B', 'BB'), (3, 'C', 'CC')");
2220

2321
$stmt = $db->prepare('SELECT id, val, val2 from test');
2422

@@ -55,7 +53,7 @@ var_dump($stmt->fetchAll(PDO::FETCH_CLASS, 'TestDerived', array(0)));
5553
<?php
5654
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
5755
$db = PDOTest::factory();
58-
$db->exec("DROP TABLE test005");
56+
PDOTest::dropTableIfExists($db, "test005");
5957
?>
6058
--EXPECTF--
6159
array(3) {

ext/pdo/tests/pdo_006.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
1616
$db = PDOTest::factory();
1717

1818
$db->exec('CREATE TABLE test006(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
19-
$db->exec("INSERT INTO test006 VALUES(1, 'A')");
20-
$db->exec("INSERT INTO test006 VALUES(2, 'A')");
21-
$db->exec("INSERT INTO test006 VALUES(3, 'C')");
19+
$db->exec("INSERT INTO test006 VALUES(1, 'A'), (2, 'A'), (3, 'C')");
2220

2321
$stmt = $db->prepare('SELECT val, id from test006');
2422

@@ -33,7 +31,7 @@ var_dump($stmt->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_GROUP));
3331
<?php
3432
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3533
$db = PDOTest::factory();
36-
$db->exec("DROP TABLE test006");
34+
PDOTest::dropTableIfExists($db, "test006");
3735
?>
3836
--EXPECT--
3937
array(2) {

ext/pdo/tests/pdo_007.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
1616
$db = PDOTest::factory();
1717

1818
$db->exec('CREATE TABLE test007(id CHAR(1) NOT NULL PRIMARY KEY, val VARCHAR(10))');
19-
$db->exec("INSERT INTO test007 VALUES('A', 'A')");
20-
$db->exec("INSERT INTO test007 VALUES('B', 'A')");
21-
$db->exec("INSERT INTO test007 VALUES('C', 'C')");
19+
$db->exec("INSERT INTO test007 VALUES('A', 'A', ('B', 'A'), ('C', 'C')");
2220

2321
$stmt = $db->prepare('SELECT id, val from test007');
2422

@@ -33,7 +31,7 @@ var_dump($stmt->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_UNIQUE));
3331
<?php
3432
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3533
$db = PDOTest::factory();
36-
$db->exec("DROP TABLE test007");
34+
PDOTest::dropTableIfExists($db, "test007");
3735
?>
3836
--EXPECT--
3937
array(3) {

ext/pdo/tests/pdo_008.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
1616
$db = PDOTest::factory();
1717

1818
$db->exec('CREATE TABLE test008(id CHAR(1) NOT NULL PRIMARY KEY, val VARCHAR(10))');
19-
$db->exec("INSERT INTO test008 VALUES('A', 'A')");
20-
$db->exec("INSERT INTO test008 VALUES('B', 'A')");
21-
$db->exec("INSERT INTO test008 VALUES('C', 'C')");
19+
$db->exec("INSERT INTO test008 VALUES('A', 'A'), ('B', 'A'), ('C', 'C')");
2220

2321
$stmt = $db->prepare('SELECT val, id from test008');
2422

@@ -30,7 +28,7 @@ var_dump($stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_UNIQUE));
3028
<?php
3129
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
3230
$db = PDOTest::factory();
33-
$db->exec("DROP TABLE test008");
31+
PDOTest::dropTableIfExists($db, "test008");
3432
?>
3533
--EXPECT--
3634
array(2) {

ext/pdo/tests/pdo_009.phpt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
1616
$db = PDOTest::factory();
1717

1818
$db->exec('CREATE TABLE classtypes009(id int NOT NULL PRIMARY KEY, name VARCHAR(10) NOT NULL UNIQUE)');
19-
$db->exec('INSERT INTO classtypes009 VALUES(0, \'stdClass\')');
20-
$db->exec('INSERT INTO classtypes009 VALUES(1, \'Test1\')');
21-
$db->exec('INSERT INTO classtypes009 VALUES(2, \'Test2\')');
19+
$db->exec("INSERT INTO classtypes009 VALUES(0, 'stdClass'), (1, 'Test1'), (2, 'Test2')");
2220
$db->exec('CREATE TABLE test009(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(10))');
23-
$db->exec('INSERT INTO test009 VALUES(1, 0, \'A\')');
24-
$db->exec('INSERT INTO test009 VALUES(2, 1, \'B\')');
25-
$db->exec('INSERT INTO test009 VALUES(3, 2, \'C\')');
26-
$db->exec('INSERT INTO test009 VALUES(4, 3, \'D\')');
21+
$db->exec('INSERT INTO test009 VALUES(1, 0, 'A'), (2, 1, 'B'), (3, 2, 'C'), (4, 3, 'D')');
2722

2823
$stmt = $db->prepare('SELECT classtypes.name, test.id AS id, test.val AS val FROM test009 LEFT JOIN classtypes009 ON test.classtype=classtypes.id');
2924

@@ -71,8 +66,8 @@ var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE, 'Test3'));
7166
<?php
7267
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
7368
$db = PDOTest::factory();
74-
$db->exec("DROP TABLE test009");
75-
$db->exec("DROP TABLE classtypes009");
69+
PDOTest::dropTableIfExists($db, "test009");
70+
PDOTest::dropTableIfExists($db, "classtypes009");
7671
?>
7772
--EXPECTF--
7873
array(4) {

0 commit comments

Comments
 (0)