List:Commits« Previous MessageNext Message »
From:uwendel Date:April 14 2008 11:41am
Subject:PHP mysqlnd svn commit: r1438 - trunk/tests/ext/pdo_mysql
View as plain text  
Author: uwendel
Date: 2008-04-14 13:41:47 +0200 (Mon, 14 Apr 2008)
New Revision: 1438

Added:
   trunk/tests/ext/pdo_mysql/pdo_mysql_attr_init_command.phpt
Log:
Fails - like __construct_options fails.


Added: trunk/tests/ext/pdo_mysql/pdo_mysql_attr_init_command.phpt
===================================================================
--- trunk/tests/ext/pdo_mysql/pdo_mysql_attr_init_command.phpt	                       
(rev 0)
+++ trunk/tests/ext/pdo_mysql/pdo_mysql_attr_init_command.phpt	2008-04-14 11:41:47 UTC
(rev 1438)
@@ -0,0 +1,49 @@
+--TEST--
+PDO::MYSQL_ATTR_INIT_COMMAND
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('mysql_pdo_test.inc');
+MySQLPDOTest::skip();
+$db = MySQLPDOTest::factory();
+?>
+--INI--
+error_reporting=E_ALL
+--FILE--
+<?php
+	require_once('mysql_pdo_test.inc');
+
+	$dsn = MySQLPDOTest::getDSN();
+	$user = PDO_MYSQL_TEST_USER;
+	$pass = PDO_MYSQL_TEST_PASS;
+
+	$table = sprintf("test_%s", md5(mt_rand(0, PHP_INT_MAX)));
+	$db = new PDO($dsn, $user, $pass);
+	$db->exec(sprintf('DROP TABLE IF EXISTS %s', $table));
+
+	$create = sprintf('CREATE TABLE %s(id INT)', $table);
+	var_dump($create);
+	$db = new PDO($dsn, $user, $pass, array(PDO::MYSQL_ATTR_INIT_COMMAND => $create));
+
+	var_dump($db->errorInfo());
+
+	$db->exec(sprintf('INSERT INTO %s(id) VALUES (1)', $table));
+	$stmt = $db->query(sprintf('SELECT id FROM %s', $table));
+	var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
+
+	$db->exec(sprintf('DROP TABLE IF EXISTS %s', $table));
+	print "done!\n";
+--EXPECTF--
+string(58) "CREATE TABLE test_%s(id INT)"
+array(1) {
+  [0]=>
+  string(5) "00000"
+}
+array(1) {
+  [0]=>
+  array(1) {
+    ["id"]=>
+    string(1) "1"
+  }
+}
+done!
\ No newline at end of file

Thread
PHP mysqlnd svn commit: r1438 - trunk/tests/ext/pdo_mysqluwendel14 Apr