List:Commits« Previous MessageNext Message »
From:uwendel Date:March 11 2008 2:42pm
Subject:PHP mysqlnd svn commit: r1347 - trunk/tests/ext/pdo
View as plain text  
Author: uwendel
Date: 2008-03-11 15:42:58 +0100 (Tue, 11 Mar 2008)
New Revision: 1347

Modified:
   trunk/tests/ext/pdo/pdo_errorinfo.phpt
   trunk/tests/ext/pdo/pdo_get_attribute_statement_class.phpt
   trunk/tests/ext/pdo/pdo_get_available_drivers.phpt
   trunk/tests/ext/pdo/pdo_last_insert_id.phpt
   trunk/tests/ext/pdo/pdo_query.phpt
   trunk/tests/ext/pdo/pdo_query_fetch_column.phpt
   trunk/tests/ext/pdo/pdo_query_tmp_invalid_fetch_class.phpt
   trunk/tests/ext/pdo/pdo_quote.phpt
   trunk/tests/ext/pdo/pdo_rollback.phpt
   trunk/tests/ext/pdo/pdo_stmt_columncount.phpt
   trunk/tests/ext/pdo/pdo_stmt_execute.phpt
   trunk/tests/ext/pdo/pdo_stmt_fetch_class_type.phpt
   trunk/tests/ext/pdo/pdo_stmt_fetchall_group.phpt
   trunk/tests/ext/pdo/pdo_stmt_fetchcolumn.phpt
   trunk/tests/ext/pdo/pdo_stmt_fetchobject.phpt
   trunk/tests/ext/pdo/pdo_stmt_getattribute.phpt
   trunk/tests/ext/pdo/pdo_stmt_rowcount.phpt
   trunk/tests/ext/pdo/pdo_stmt_set_fetchmode.phpt
   trunk/tests/ext/pdo/pdo_stmt_setattribute.phpt
Log:
Tweaking the tests in the hope to make them a little bit more portable.
Each and every PDO driver behaves differently and although I keep those tests in ext/pdo
the tests are not 100% portable among every driver. I leave it to the community to fiddle
out the last 
details...


Modified: trunk/tests/ext/pdo/pdo_errorinfo.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_errorinfo.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_errorinfo.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -127,5 +127,5 @@
   0 => '00000',
 )/array
 [006] Unexpected error code, [00000] 00000
-[007] 'THIS IS NO VALID SQL, I HOPE' has not failed, [42000] 42000 1064 You have an error
in your SQL syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near 'THIS IS NO VALID SQL, I HOPE' at line 1
+[007] 'THIS IS NO VALID SQL, I HOPE' has not failed, [%s] %s
 done!
\ No newline at end of file

Modified: trunk/tests/ext/pdo/pdo_get_attribute_statement_class.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_get_attribute_statement_class.phpt	2008-03-11 13:58:40 UTC
(rev 1346)
+++ trunk/tests/ext/pdo/pdo_get_attribute_statement_class.phpt	2008-03-11 14:42:58 UTC
(rev 1347)
@@ -24,5 +24,5 @@
 --EXPECTF--
 Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS
requires format array(classname, array(ctor_args)); the classname must be a string
specifying an existing class in %s on line %d
 
-Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: 1051 Unknown table
'classtypes' in %s on line %d
+Warning: PDO::setAttribute(): SQLSTATE[HY000]: %s
 done!
\ No newline at end of file

Modified: trunk/tests/ext/pdo/pdo_get_available_drivers.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_get_available_drivers.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_get_available_drivers.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -1,5 +1,5 @@
 --TEST--
-PDO Common: PDOStatement::getAvailableDrivers()
+PDO Common: PDO::getAvailableDrivers()
 --SKIPIF--
 <?php # vim:ft=php
 if (!extension_loaded('pdo')) die('skip');

Modified: trunk/tests/ext/pdo/pdo_last_insert_id.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_last_insert_id.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_last_insert_id.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -1,5 +1,5 @@
 --TEST--
-PDO Common: PDOStatement::lastInsertId()
+PDO Common: PDO->lastInsertId()
 --SKIPIF--
 <?php # vim:ft=php
 if (!extension_loaded('pdo')) die('skip');
@@ -9,7 +9,7 @@
 PDOTest::skip();
 $db = PDOTest::factory();
 try {
-	$tmp = $db->lastInsertId('foo');
+	$tmp = @$db->lastInsertId('foo');
 	if ($db->errorCode() == 'IM001')
 		die("skip not supported");
 } catch (PDOException $e) {

Modified: trunk/tests/ext/pdo/pdo_query.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_query.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_query.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -230,14 +230,14 @@
 [009] Mode = 8
 array(2) {
   [0]=>
-  object(fetch_class)#8 (2) {
+  object(fetch_class)#%d (2) {
     ["id"]=>
     string(1) "1"
     ["val"]=>
     string(1) "A"
   }
   [1]=>
-  object(fetch_class)#9 (2) {
+  object(fetch_class)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -250,7 +250,7 @@
 [011] Mode = 8
 array(2) {
   [0]=>
-  object(fetch_class_private_members)#2 (2) {
+  object(fetch_class_private_members)#%d (2) {
     ["id":"fetch_class_private_members":private"]=>
     string(1) "1"
     ["val":"fetch_class_private_members":private"]=>
@@ -267,14 +267,14 @@
 [012] Mode = 8
 array(2) {
   [0]=>
-  object(fetch_class_private_constructor)#8 (2) {
+  object(fetch_class_private_constructor)#%d (2) {
     ["id"]=>
     string(1) "1"
     ["val"]=>
     string(1) "A"
   }
   [1]=>
-  object(fetch_class_private_constructor)#9 (2) {
+  object(fetch_class_private_constructor)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -284,7 +284,7 @@
 [013] Mode = 8
 array(2) {
   [0]=>
-  object(fetch_class_constructor_params)#2 (2) {
+  object(fetch_class_constructor_params)#%d (2) {
     ["id"]=>
     string(4) "myid"
     ["val"]=>
@@ -301,14 +301,14 @@
 [014] Mode = 8
 array(2) {
   [0]=>
-  object(fetch_class_interceptor)#8 (2) {
+  object(fetch_class_interceptor)#%d (2) {
     ["id"]=>
     string(7) "val = 1"
     ["val"]=>
     string(7) "val = A"
   }
   [1]=>
-  object(fetch_class_interceptor)#9 (2) {
+  object(fetch_class_interceptor)#%d (2) {
     ["id"]=>
     string(7) "val = 2"
     ["val"]=>
@@ -321,14 +321,14 @@
 [016] Mode = 9
 array(2) {
   [0]=>
-  object(fetch_class)#9 (2) {
+  object(fetch_class)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
     string(1) "B"
   }
   [1]=>
-  object(fetch_class)#9 (2) {
+  object(fetch_class)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -338,14 +338,14 @@
 [017] Mode = 9
 array(2) {
   [0]=>
-  object(fetch_class_constructor_params)#7 (2) {
+  object(fetch_class_constructor_params)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
     string(1) "B"
   }
   [1]=>
-  object(fetch_class_constructor_params)#7 (2) {
+  object(fetch_class_constructor_params)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -355,14 +355,14 @@
 [018] Mode = 9
 array(2) {
   [0]=>
-  object(fetch_class_interceptor)#6 (2) {
+  object(fetch_class_interceptor)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
     string(1) "B"
   }
   [1]=>
-  object(fetch_class_interceptor)#6 (2) {
+  object(fetch_class_interceptor)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -518,14 +518,14 @@
 [009] Mode = 8
 array(2) {
   [0]=>
-  object(fetch_class)#8 (2) {
+  object(fetch_class)#%d (2) {
     ["id"]=>
     string(1) "1"
     ["val"]=>
     string(1) "A"
   }
   [1]=>
-  object(fetch_class)#9 (2) {
+  object(fetch_class)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -533,19 +533,19 @@
   }
 }
 
-Warning: PDO::query(): SQLSTATE[]: <<Unknown error>> in %s on line %d
-[010] PDO::query() failed, [] 
+Warning: PDO::query(): SQLSTATE[]: <<Unknown error>%s in %s on line %d
+[010] PDO::query() failed, %s
 [011] Mode = 8
 array(2) {
   [0]=>
-  object(fetch_class_private_members)#2 (2) {
+  object(fetch_class_private_members)#%d (2) {
     ["id":"fetch_class_private_members":private]=>
     string(1) "1"
     ["val":"fetch_class_private_members":private]=>
     string(1) "A"
   }
   [1]=>
-  object(fetch_class_private_members)#5 (2) {
+  object(fetch_class_private_members)#%d (2) {
     ["id":"fetch_class_private_members":private]=>
     string(1) "2"
     ["val":"fetch_class_private_members":private]=>
@@ -555,14 +555,14 @@
 [012] Mode = 8
 array(2) {
   [0]=>
-  object(fetch_class_private_constructor)#8 (2) {
+  object(fetch_class_private_constructor)#%d (2) {
     ["id"]=>
     string(1) "1"
     ["val"]=>
     string(1) "A"
   }
   [1]=>
-  object(fetch_class_private_constructor)#9 (2) {
+  object(fetch_class_private_constructor)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -572,14 +572,14 @@
 [013] Mode = 8
 array(2) {
   [0]=>
-  object(fetch_class_constructor_params)#2 (2) {
+  object(fetch_class_constructor_params)#%d (2) {
     ["id"]=>
     string(4) "myid"
     ["val"]=>
     string(1) "A"
   }
   [1]=>
-  object(fetch_class_constructor_params)#5 (2) {
+  object(fetch_class_constructor_params)#%d (2) {
     ["id"]=>
     string(4) "myid"
     ["val"]=>
@@ -589,14 +589,14 @@
 [014] Mode = 8
 array(2) {
   [0]=>
-  object(fetch_class_interceptor)#8 (2) {
+  object(fetch_class_interceptor)#%d (2) {
     ["id"]=>
     string(7) "val = 1"
     ["val"]=>
     string(7) "val = A"
   }
   [1]=>
-  object(fetch_class_interceptor)#9 (2) {
+  object(fetch_class_interceptor)#%d (2) {
     ["id"]=>
     string(7) "val = 2"
     ["val"]=>
@@ -604,19 +604,19 @@
   }
 }
 
-Warning: PDO::query(): SQLSTATE[]: <<Unknown error>> in %s on line %d
-[015] PDO::query() failed, [] 
+Warning: PDO::query(): SQLSTATE[]: <<Unknown error>%s in %s on line %d
+[015] PDO::query() failed, %s
 [016] Mode = 9
 array(2) {
   [0]=>
-  object(fetch_class)#9 (2) {
+  object(fetch_class)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
     string(1) "B"
   }
   [1]=>
-  object(fetch_class)#9 (2) {
+  object(fetch_class)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -626,14 +626,14 @@
 [017] Mode = 9
 array(2) {
   [0]=>
-  object(fetch_class_constructor_params)#7 (2) {
+  object(fetch_class_constructor_params)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
     string(1) "B"
   }
   [1]=>
-  object(fetch_class_constructor_params)#7 (2) {
+  object(fetch_class_constructor_params)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -643,14 +643,14 @@
 [018] Mode = 9
 array(2) {
   [0]=>
-  object(fetch_class_interceptor)#6 (2) {
+  object(fetch_class_interceptor)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
     string(1) "B"
   }
   [1]=>
-  object(fetch_class_interceptor)#6 (2) {
+  object(fetch_class_interceptor)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -660,7 +660,7 @@
 [019] Mode = 1
 array(2) {
   [0]=>
-  object(PDORow)#5 (3) {
+  object(PDORow)#%d (3) {
     ["queryString"]=>
     string(24) "SELECT id, val FROM test"
     ["id"]=>
@@ -669,7 +669,7 @@
     NULL
   }
   [1]=>
-  object(PDORow)#5 (3) {
+  object(PDORow)#%d (3) {
     ["queryString"]=>
     string(24) "SELECT id, val FROM test"
     ["id"]=>
@@ -681,14 +681,14 @@
 [020] Mode = 5
 array(2) {
   [0]=>
-  object(stdClass)#12 (2) {
+  object(stdClass)#%d (2) {
     ["id"]=>
     string(1) "1"
     ["val"]=>
     string(1) "A"
   }
   [1]=>
-  object(stdClass)#13 (2) {
+  object(stdClass)#%d (2) {
     ["id"]=>
     string(1) "2"
     ["val"]=>
@@ -713,8 +713,8 @@
   }
 }
 
-Warning: PDO::query(): SQLSTATE[]: <<Unknown error>> in %s on line %d
-[022] PDO::query() failed, [] 
+Warning: PDO::query(): SQLSTATE[]: <<Unknown error>%s in %s on line %d
+[022] PDO::query() failed, %s
 [023] Mode = 7
 array(2) {
   [0]=>
@@ -736,4 +736,4 @@
   [1]=>
   string(1) "2"
 }
-done!
+done!
\ No newline at end of file

Modified: trunk/tests/ext/pdo/pdo_query_fetch_column.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_query_fetch_column.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_query_fetch_column.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -70,7 +70,7 @@
 Warning: PDO::query(): SQLSTATE[TODO]: any meaningful message about invalid offset in %s
on line %d
 done!
 --EXPECTF--
-Warning: PDO::query(): SQLSTATE[]: <<Unknown error>> in %s on line %d
+Warning: PDO::query(): SQLSTATE[]: <<Unknown error>%s in %s on line %d
 [002] Expecting false/boolean because of invalid column offset got
PDOStatement::__set_state(array(
    'queryString' => 'SELECT id, val, grp FROM test ORDER BY id ASC',
 ))/object

Modified: trunk/tests/ext/pdo/pdo_query_tmp_invalid_fetch_class.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_query_tmp_invalid_fetch_class.phpt	2008-03-11 13:58:40 UTC
(rev 1346)
+++ trunk/tests/ext/pdo/pdo_query_tmp_invalid_fetch_class.phpt	2008-03-11 14:42:58 UTC
(rev 1347)
@@ -40,7 +40,7 @@
 Warning: PDO::query(): SQLSTATE[IM001]: Unknow class or similar message in %s on line %d
 done!
 --EXPECTF--
-Warning: PDO::query(): SQLSTATE[]: <<Unknown error>> in %s on line %d
+Warning: PDO::query(): SQLSTATE[]: <<Unknown error>%s in %s on line %d
 array(1) {
   [0]=>
   string(0) ""

Modified: trunk/tests/ext/pdo/pdo_quote.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_quote.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_quote.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -1,6 +1,5 @@
 --TEST--
-PDO Common: PDO->quote() - Quotes a string for use in a query.
-
+PDO Common: PDO->quote() - Quotes a string for use in a query
 --SKIPIF--
 <?php # vim:ft=php
 if (!extension_loaded('pdo')) die('skip');

Modified: trunk/tests/ext/pdo/pdo_rollback.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_rollback.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_rollback.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -1,6 +1,5 @@
 --TEST--
 PDO Common: PDO->rollBack() — Rolls back a transaction
-
 --SKIPIF--
 <?php # vim:ft=php
 if (!extension_loaded('pdo')) die('skip');

Modified: trunk/tests/ext/pdo/pdo_stmt_columncount.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_columncount.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_stmt_columncount.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -46,10 +46,6 @@
 	$stmt->execute();
 	var_dump($stmt->columnCount());
 
-	$stmt = $db->prepare('SELECT id, val, "?" as foo FROM test');
-	$stmt->execute();
-	var_dump($stmt->columnCount());
-
 	$stmt = $db->prepare('SELECT * FROM test');
 	$stmt->execute();
 	var_dump($stmt->columnCount());
@@ -67,9 +63,6 @@
 	$stmt = $db->query('SELECT id, val FROM test');
 	var_dump($stmt->columnCount());
 
-	$stmt = $db->query('SELECT id, val, "?" as foo FROM test');
-	var_dump($stmt->columnCount());
-
 	$stmt = $db->query('SELECT * FROM test');
 	var_dump($stmt->columnCount());
 
@@ -88,12 +81,10 @@
 int(1)
 int(2)
 int(3)
-int(3)
 int(0)
 Testing query() - should give the very same results...
 int(1)
 int(2)
 int(3)
-int(3)
 int(0)
 done!
\ No newline at end of file

Modified: trunk/tests/ext/pdo/pdo_stmt_execute.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_execute.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_stmt_execute.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -47,7 +47,7 @@
 	if (false !== ($tmp = @$stmt->execute()))
 		printf("[007] Missing input parameter not detected got %s\n", var_export($tmp, true));
 
-	if (true !== ($stmt->execute(array(1))))
+	if (true !== ($tmp = $stmt->execute(array(1))))
 		printf("[008] Expecting true got %s\n", var_export($tmp, true));
 
 	if (false !== ($tmp = @$stmt->execute(array('id' => 1))))
@@ -64,7 +64,7 @@
 	if (false !== ($tmp = @$stmt->execute()))
 		printf("[012] Missing input parameter not detected got %s\n", var_export($tmp, true));
 
-	if (false !== (@$stmt->execute(array(1))))
+	if (false !== ($tmp = @$stmt->execute(array(1))))
 		printf("[013] Expecting false got %s\n", var_export($tmp, true));
 
 	if (true !== ($tmp = $stmt->execute(array('input' => 1))))

Modified: trunk/tests/ext/pdo/pdo_stmt_fetch_class_type.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_fetch_class_type.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_stmt_fetch_class_type.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -14,9 +14,9 @@
 require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
 $db = PDOTest::factory();
 
-$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp
VARCHAR(10))');
-$db->exec('INSERT INTO test VALUES(1, \'A\', \'myclass_rs\')');
-$db->exec('INSERT INTO test VALUES(2, \'B\', \'myclass_unknown\')');
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp
VARCHAR(20))');
+$db->exec("INSERT INTO test VALUES(1, 'A', 'myclass_rs')");
+$db->exec("INSERT INTO test VALUES(2, 'B', 'myclass_unknown')");
 
 try {
 

Modified: trunk/tests/ext/pdo/pdo_stmt_fetchall_group.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_fetchall_group.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_stmt_fetchall_group.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -15,9 +15,9 @@
 $db = PDOTest::factory();
 
 $db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY,grp VARCHAR(10), val
VARCHAR(10))');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(5, "A", "5-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(6, "A", "6-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(7, "B", "7-B")');
+$db->exec("INSERT INTO test(id, grp, val) VALUES(5, 'A', '5-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(6, 'A', '6-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(7, 'B', '7-B')");
 
 try {
 

Modified: trunk/tests/ext/pdo/pdo_stmt_fetchcolumn.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_fetchcolumn.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_stmt_fetchcolumn.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -15,9 +15,9 @@
 $db = PDOTest::factory();
 
 $db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY,grp VARCHAR(10), val
VARCHAR(10))');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(5, "A", "5-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(6, "A", "6-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(7, "B", "7-B")');
+$db->exec("INSERT INTO test(id, grp, val) VALUES(5, 'A', '5-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(6, 'A', '6-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(7, 'B', '7-B')");
 
 try {
 

Modified: trunk/tests/ext/pdo/pdo_stmt_fetchobject.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_fetchobject.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_stmt_fetchobject.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -14,15 +14,15 @@
 require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
 $db = PDOTest::factory();
 
-$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY,grp VARCHAR(10), val
VARCHAR(10))');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(5, "A", "5-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(6, "A", "6-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(7, "B", "7-B")');
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, grp VARCHAR(10), val
VARCHAR(10))');
+$db->exec("INSERT INTO test(id, grp, val) VALUES(5, 'A', '5-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(6, 'A', '6-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(7, 'B', '7-B')");
 
 try {
 
 	// default settings
-	$query = 'SELECT id, grp, val, "", NULL FROM test ORDER BY id ASC';
+	$query = "SELECT id, grp, val, NULL AS null_column FROM test ORDER BY id ASC";
 	$stmt = $db->prepare($query);
 	$stmt->execute();
 	$expected = $stmt->fetchAll(PDO::FETCH_ASSOC);
@@ -58,7 +58,7 @@
 		// NOTE: PDO will call __set() prior to calling __construct()
 		public function __set($prop, $value) {
 			$this->not_a_magic_one();
-			printf("myclass::__set(%s, %s) %d\n",
+			printf("myclass::__set(%s, -%s-) %d\n",
 				$prop, var_export($value, true), $this->set_calls, self::$static_set_calls);
 			$this->{$prop} = $value;
 		}
@@ -86,33 +86,28 @@
 print "done!";
 ?>
 --EXPECTF--
-myclass::__set(id, '5') 1
-myclass::__set(val, '5-A') 2
-myclass::__set("", '') 3
-myclass::__set(null, NULL) 4
-myclass::__construct(0, 1): 4 / 4
-myclass::__set(id, '6') 1
-myclass::__set(val, '6-A') 2
-myclass::__set("", '') 3
-myclass::__set(null, NULL) 4
-myclass::__construct(1, 2): 8 / 4
-myclass::__set(id, '7') 1
-myclass::__set(val, '7-B') 2
-myclass::__set("", '') 3
-myclass::__set(null, NULL) 4
-myclass::__construct(2, 3): 12 / 4
-object(myclass)#%d (6) {
+myclass::__set(id, -'5'-) 1
+myclass::__set(val, -'5-A'-) 2
+myclass::__set(null_column, -NULL-) 3
+myclass::__construct(0, 1): 3 / 3
+myclass::__set(id, -'6'-) 1
+myclass::__set(val, -'6-A'-) 2
+myclass::__set(null_column, -NULL-) 3
+myclass::__construct(1, 2): 6 / 3
+myclass::__set(id, -'7'-) 1
+myclass::__set(val, -'7-B'-) 2
+myclass::__set(null_column, -NULL-) 3
+myclass::__construct(2, 3): 9 / 3
+object(myclass)#%d (5) {
   ["set_calls":"myclass":private]=>
-  int(4)
+  int(3)
   ["grp":protected]=>
   string(1) "B"
   ["id"]=>
   string(1) "7"
   ["val"]=>
   string(3) "7-B"
-  [""""]=>
-  string(0) ""
-  ["null"]=>
+  ["null_column"]=>
   NULL
 }
 done!
\ No newline at end of file

Modified: trunk/tests/ext/pdo/pdo_stmt_getattribute.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_getattribute.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_stmt_getattribute.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -15,9 +15,9 @@
 $db = PDOTest::factory();
 
 $db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY,grp VARCHAR(10), val
VARCHAR(10))');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(5, "A", "5-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(6, "A", "6-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(7, "B", "7-B")');
+$db->exec("INSERT INTO test(id, grp, val) VALUES(5, 'A', '5-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(6, 'A', '6-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(7, 'B', '7-B')");
 
 try {
 

Modified: trunk/tests/ext/pdo/pdo_stmt_rowcount.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_rowcount.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_stmt_rowcount.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -15,37 +15,37 @@
 $db = PDOTest::factory();
 
 $db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY,grp VARCHAR(10), val
VARCHAR(10))');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(5, "A", "5-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(6, "A", "6-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(7, "B", "7-B")');
+$db->exec("INSERT INTO test(id, grp, val) VALUES(5, 'A', '5-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(6, 'A', '6-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(7, 'B', '7-B')");
 
 try {
 
 	// UPDATE
-	if (0 !== ($tmp = $db->query('UPDATE test SET grp = "C" WHERE id =
8')->rowCount()))
+	if (0 !== ($tmp = $db->query("UPDATE test SET grp = 'C' WHERE id =
8")->rowCount()))
 		printf("[002] Expecting 0 got %s\n", var_export($tmp, true));
 
-	if (1 !== ($tmp = $db->query('UPDATE test SET grp = "C" WHERE id =
5')->rowCount()))
+	if (1 !== ($tmp = $db->query("UPDATE test SET grp = 'C' WHERE id =
5")->rowCount()))
 		printf("[003] Expecting 1 got %s\n", var_export($tmp, true));
 
-	if (1 !== ($tmp = $db->query('UPDATE test SET grp = "C" WHERE id =
6')->rowCount()))
+	if (1 !== ($tmp = $db->query("UPDATE test SET grp = 'C' WHERE id =
6")->rowCount()))
 		printf("[004] Expecting 1 got %s\n", var_export($tmp, true));
 
-	if (2 !== ($tmp = $db->query('UPDATE test SET grp = "D" WHERE grp =
"C"')->rowCount()))
+	if (2 !== ($tmp = $db->query("UPDATE test SET grp = 'D' WHERE grp =
'C'")->rowCount()))
 		printf("[005] Expecting 1 got %s\n", var_export($tmp, true));
 
 	// INSERT
-	if (1 !== ($tmp = $db->query('INSERT INTO test(id, grp, val) VALUES(8, "D",
"8-D")')->rowCount()))
+	if (1 !== ($tmp = $db->query("INSERT INTO test(id, grp, val) VALUES(8, 'D',
'8-D')")->rowCount()))
 		printf("[006] Expecting 1 got %s\n", var_export($tmp, true));
 
 	// DELETE
-	if (3 !== ($tmp = $db->query('DELETE FROM test WHERE grp = "D"')->rowCount()))
+	if (3 !== ($tmp = $db->query("DELETE FROM test WHERE grp = 'D'")->rowCount()))
 		printf("[007] Expecting 3 got %s\n", var_export($tmp, true));
 
-	if (0 !== ($tmp = $db->query('DELETE FROM test WHERE grp = "D"')->rowCount()))
+	if (0 !== ($tmp = $db->query("DELETE FROM test WHERE grp = 'D'")->rowCount()))
 		printf("[008] Expecting 0 got %s\n", var_export($tmp, true));
 
-	if (1 !== ($tmp = $db->query('DELETE FROM test')->rowCount()))
+	if (1 !== ($tmp = $db->query("DELETE FROM test")->rowCount()))
 		printf("[009] Expecting 1 got %s\n", var_export($tmp, true));
 
 	// parameter handling

Modified: trunk/tests/ext/pdo/pdo_stmt_set_fetchmode.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_set_fetchmode.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_stmt_set_fetchmode.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -15,11 +15,10 @@
 $db = PDOTest::factory();
 
 $db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY,grp VARCHAR(10), val
VARCHAR(10))');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(5, "A", "5-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(6, "A", "6-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(7, "B", "7-B")');
+$db->exec("INSERT INTO test(id, grp, val) VALUES(5, 'A', '5-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(6, 'A', '6-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(7, 'B', '7-B')");
 
-
 // NOTE: The different fetch modes itself are covered by other tests
 // This test is about the parameter handling only
 try {

Modified: trunk/tests/ext/pdo/pdo_stmt_setattribute.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_setattribute.phpt	2008-03-11 13:58:40 UTC (rev 1346)
+++ trunk/tests/ext/pdo/pdo_stmt_setattribute.phpt	2008-03-11 14:42:58 UTC (rev 1347)
@@ -15,9 +15,9 @@
 $db = PDOTest::factory();
 
 $db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY,grp VARCHAR(10), val
VARCHAR(10))');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(5, "A", "5-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(6, "A", "6-A")');
-$db->exec('INSERT INTO test(id, grp, val) VALUES(7, "B", "7-B")');
+$db->exec("INSERT INTO test(id, grp, val) VALUES(5, 'A', '5-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(6, 'A', '6-A')");
+$db->exec("INSERT INTO test(id, grp, val) VALUES(7, 'B', '7-B')");
 
 try {
 

Thread
PHP mysqlnd svn commit: r1347 - trunk/tests/ext/pdouwendel12 Mar