diff options
author | SVN Migration <svn@php.net> | 2006-10-15 21:09:28 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2006-10-15 21:09:28 +0000 |
commit | 88ec761548b66f58acc1a86cdd0fc164ca925476 (patch) | |
tree | d0af978fa00d83bb1d82c613f66477fbd6bb18aa /ext/pdo_mysql/tests | |
parent | 268984b4787e797db6054313fc9ba3b9e845306e (diff) | |
download | php-git-PECL_OPENSSL.tar.gz |
This commit was manufactured by cvs2svn to create branch 'PECL_OPENSSL'.PECL_OPENSSL
Diffstat (limited to 'ext/pdo_mysql/tests')
-rw-r--r-- | ext/pdo_mysql/tests/bug_33689.phpt | 52 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/bug_37445.phpt | 21 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/common.phpt | 28 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/config.inc | 19 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/last_insert_id.phpt | 36 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/pecl_bug_5200.phpt | 31 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/pecl_bug_5780.phpt | 42 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/pecl_bug_5802.phpt | 53 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/show_tables.phpt | 21 |
9 files changed, 0 insertions, 303 deletions
diff --git a/ext/pdo_mysql/tests/bug_33689.phpt b/ext/pdo_mysql/tests/bug_33689.phpt deleted file mode 100644 index bd0a40904a..0000000000 --- a/ext/pdo_mysql/tests/bug_33689.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -PDO MySQL Bug #33689 ---SKIPIF-- -<?php -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); -require dirname(__FILE__) . '/config.inc'; -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); -PDOTest::skip(); -?> ---FILE-- -<?php -require dirname(__FILE__) . '/config.inc'; -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); - -$db->exec('CREATE TABLE test (bar INT NOT NULL)'); -$db->exec('INSERT INTO test VALUES(1)'); - -var_dump($db->query('SELECT * from test')); -foreach ($db->query('SELECT * from test') as $row) { - print_r($row); -} - -$stmt = $db->prepare('SELECT * from test'); -print_r($stmt->getColumnMeta(0)); -$stmt->execute(); -print_r($stmt->getColumnMeta(0)); - ---EXPECTF-- -object(PDOStatement)#%d (1) { - ["queryString"]=> - string(18) "SELECT * from test" -} -Array -( - [bar] => 1 - [0] => 1 -) -Array -( - [native_type] => LONG - [flags] => Array - ( - [0] => not_null - ) - - [name] => bar - [len] => 11 - [precision] => 0 - [pdo_type] => 2 -) diff --git a/ext/pdo_mysql/tests/bug_37445.phpt b/ext/pdo_mysql/tests/bug_37445.phpt deleted file mode 100644 index c4d760083d..0000000000 --- a/ext/pdo_mysql/tests/bug_37445.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -PDO MySQL Bug #37445 (Premature stmt object destruction) ---SKIPIF-- -<?php -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); -require dirname(__FILE__) . '/config.inc'; -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); -PDOTest::skip(); -?> ---FILE-- -<?php -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); - -$db->setAttribute(PDO :: ATTR_EMULATE_PREPARES, true); -$stmt = $db->prepare("SELECT 1"); -$stmt->bindParam(':a', 'b'); - ---EXPECTF-- -Fatal error: Cannot pass parameter 2 by reference in %s/bug_37445.php on line %d
\ No newline at end of file diff --git a/ext/pdo_mysql/tests/common.phpt b/ext/pdo_mysql/tests/common.phpt deleted file mode 100644 index 8179454cf7..0000000000 --- a/ext/pdo_mysql/tests/common.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -MySQL ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) print 'skip not loaded'; -?> ---REDIRECTTEST-- -# magic auto-configuration - -$config = array( - 'TESTS' => 'ext/pdo/tests' -); - -if (false !== getenv('PDO_MYSQL_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN'); - $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER'); - $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS'); - if (false !== getenv('PDO_MYSQL_TEST_ATTR')) { - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR'); - } -} else { - $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test'; - $config['ENV']['PDOTEST_USER'] = 'root'; - $config['ENV']['PDOTEST_PASS'] = ''; -} - -return $config; diff --git a/ext/pdo_mysql/tests/config.inc b/ext/pdo_mysql/tests/config.inc deleted file mode 100644 index 855f89bc1e..0000000000 --- a/ext/pdo_mysql/tests/config.inc +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -if (false !== getenv('PDO_MYSQL_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN'); - $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER'); - $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS'); - if (false !== getenv('PDO_MYSQL_TEST_ATTR')) { - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR'); - } -} else { - $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test'; - $config['ENV']['PDOTEST_USER'] = 'root'; - $config['ENV']['PDOTEST_PASS'] = ''; -} - -foreach ($config['ENV'] as $k => $v) { - putenv("$k=$v"); -} diff --git a/ext/pdo_mysql/tests/last_insert_id.phpt b/ext/pdo_mysql/tests/last_insert_id.phpt deleted file mode 100644 index d48ba14992..0000000000 --- a/ext/pdo_mysql/tests/last_insert_id.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -PDO MySQL auto_increment / last insert id ---SKIPIF-- -<?php -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); -require dirname(__FILE__) . '/config.inc'; -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); -PDOTest::skip(); -?> ---FILE-- -<?php -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); - -print_r($db->query("CREATE TABLE test (id int auto_increment primary key, num int)")); - -print_r($db->query("INSERT INTO test (id, num) VALUES (23, 42)")); - -print_r($db->query("INSERT INTO test (num) VALUES (451)")); - -print_r($db->lastInsertId()); ---EXPECT-- -PDOStatement Object -( - [queryString] => CREATE TABLE test (id int auto_increment primary key, num int) -) -PDOStatement Object -( - [queryString] => INSERT INTO test (id, num) VALUES (23, 42) -) -PDOStatement Object -( - [queryString] => INSERT INTO test (num) VALUES (451) -) -24
\ No newline at end of file diff --git a/ext/pdo_mysql/tests/pecl_bug_5200.phpt b/ext/pdo_mysql/tests/pecl_bug_5200.phpt deleted file mode 100644 index 639a640c8a..0000000000 --- a/ext/pdo_mysql/tests/pecl_bug_5200.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -PDO MySQL PECL Bug #5200 ---SKIPIF-- -<?php -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); -require dirname(__FILE__) . '/config.inc'; -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); -PDOTest::skip(); -?> ---FILE-- -<?php -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt'); - -$db->exec("CREATE TABLE test (bar INT NOT NULL, phase enum('please_select', 'I', 'II', 'IIa', 'IIb', 'III', 'IV'))"); - -foreach ($db->query('DESCRIBE test phase')->fetchAll(PDO::FETCH_ASSOC) as $row) { - print_r($row); -} - ---EXPECT-- -Array -( - [field] => phase - [type] => enum('please_select','I','II','IIa','IIb','III','IV') - [null] => YES - [key] => - [default] => - [extra] => -) diff --git a/ext/pdo_mysql/tests/pecl_bug_5780.phpt b/ext/pdo_mysql/tests/pecl_bug_5780.phpt deleted file mode 100644 index ef94db13cc..0000000000 --- a/ext/pdo_mysql/tests/pecl_bug_5780.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -PDO MySQL PECL Bug #5780 ---SKIPIF-- -<?php # vim:ft=php: -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); -require dirname(__FILE__) . '/config.inc'; -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); -PDOTest::skip(); -?> ---FILE-- -<?php -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt'); - -$db->exec("CREATE TABLE test (login varchar(32) NOT NULL, data varchar(64) NOT NULL)"); -$db->exec("CREATE TABLE test2 (login varchar(32) NOT NULL, password varchar(64) NOT NULL)"); -$db->exec("INSERT INTO test2 (login, password) VALUES ('testing', 'testing')"); -$db->exec("INSERT INTO test2 (login, password) VALUES ('test2', 'testpw2')"); - -$logstmt = $db->prepare('INSERT INTO test (login, data) VALUES (:var1, :var2)'); -$authstmt = $db->prepare('SELECT * FROM test2 WHERE login = :varlog AND password = :varpass'); -$authstmt->execute(array(':varlog' => 'testing', ':varpass' => 'testing')); -var_dump($authstmt->fetch(PDO::FETCH_NUM)); -@var_dump($logstmt->execute(array(':var1' => 'test1', ':var2' => 'test2'))); -$info = $logstmt->errorInfo(); -unset($info[2]); -var_dump($info); ---EXPECT-- -array(2) { - [0]=> - string(7) "testing" - [1]=> - string(7) "testing" -} -bool(false) -array(2) { - [0]=> - string(5) "HY000" - [1]=> - int(2014) -} diff --git a/ext/pdo_mysql/tests/pecl_bug_5802.phpt b/ext/pdo_mysql/tests/pecl_bug_5802.phpt deleted file mode 100644 index f154dd13a9..0000000000 --- a/ext/pdo_mysql/tests/pecl_bug_5802.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -PDO MySQL PECL Bug #5802 ---SKIPIF-- -<?php # vim:ft=php: -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); -require dirname(__FILE__) . '/config.inc'; -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); -PDOTest::skip(); -?> ---FILE-- -<?php -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt'); - -$db->exec('create table test ( bar char(3) NULL )'); -$stmt = $db->prepare('insert into test (bar) values(:bar)') or var_dump($db->errorInfo()); - -$bar = 'foo'; -$stmt->bindParam(':bar', $bar); -$stmt->execute() or var_dump($stmt->errorInfo()); - -$bar = null; -$stmt->bindParam(':bar', $bar); -$stmt->execute() or var_dump($stmt->errorInfo()); - -$bar = 'qaz'; -$stmt->bindParam(':bar', $bar); -$stmt->execute() or var_dump($stmt->errorInfo()); - -$stmt = $db->prepare('select * from test') or var_dump($db->errorInfo()); - -if($stmt) $stmt->execute(); -if($stmt) var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); - ---EXPECT-- -array(3) { - [0]=> - array(1) { - ["bar"]=> - string(3) "foo" - } - [1]=> - array(1) { - ["bar"]=> - NULL - } - [2]=> - array(1) { - ["bar"]=> - string(3) "qaz" - } -} diff --git a/ext/pdo_mysql/tests/show_tables.phpt b/ext/pdo_mysql/tests/show_tables.phpt deleted file mode 100644 index 97dfe686e7..0000000000 --- a/ext/pdo_mysql/tests/show_tables.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -PDO MySQL SHOW TABLES ---SKIPIF-- -<?php -if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); -require dirname(__FILE__) . '/config.inc'; -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); -PDOTest::skip(); -?> ---FILE-- -<?php -require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; -$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); - -print_r($db->query('SHOW TABLES')); ---EXPECT-- -PDOStatement Object -( - [queryString] => SHOW TABLES -) |