Annotation of embedaddon/php/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: MySQL PDOStatement->rowCount() @ SELECT
3: --SKIPIF--
4: <?php
5: require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
6: require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
7: MySQLPDOTest::skip();
8: ?>
9: --FILE--
10: <?php
11: require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
12: $db = MySQLPDOTest::factory();
13: MySQLPDOTest::createTestTable($db);
14:
15: try {
16:
17: if (0 !== ($tmp = $db->query('SELECT id FROM test WHERE 1 = 0')->rowCount()))
18: printf("[002] Expecting 0 got %s", var_export($tmp, true));
19:
20: if (1 !== ($tmp = $db->query('SELECT id FROM test WHERE id = 1')->rowCount()))
21: printf("[003] Expecting 1 got %s", var_export($tmp, true));
22:
23: } catch (PDOException $e) {
24: printf("[001] %s [%s] %s\n",
25: $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
26: }
27:
28: print "done!";
29: ?>
30: --CLEAN--
31: <?php
32: require dirname(__FILE__) . '/mysql_pdo_test.inc';
33: MySQLPDOTest::dropTestTable();
34: ?>
35: --EXPECTF--
36: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>