]> granicus.if.org Git - php/commitdiff
- New tests (code coverage++)
authorFelipe Pena <felipe@php.net>
Sun, 19 Jun 2011 12:33:49 +0000 (12:33 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 19 Jun 2011 12:33:49 +0000 (12:33 +0000)
ext/pdo_sqlite/tests/pdo_sqlite_createaggregate_002.phpt [new file with mode: 0644]
ext/pdo_sqlite/tests/pdo_sqlite_get_attribute.phpt [new file with mode: 0644]

diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate_002.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate_002.phpt
new file mode 100644 (file)
index 0000000..671e4b3
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+PDO_sqlite: Testing invalid callback for sqliteCreateAggregate()
+--SKIPIF--
+<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?>
+--FILE--
+<?php
+
+$pdo = new PDO('sqlite::memory:');
+
+$pdo->sqliteCreateAggregate('foo', 'a', '');
+$pdo->sqliteCreateAggregate('foo', 'strlen', '');
+
+?>
+--EXPECTF--
+Warning: PDO::sqliteCreateAggregate(): function 'a' is not callable in %s on line %d
+
+Warning: PDO::sqliteCreateAggregate(): function '' is not callable in %s on line %d
diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_get_attribute.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_get_attribute.phpt
new file mode 100644 (file)
index 0000000..d6e095d
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+PDO_sqlite: Testing getAttribute()
+--SKIPIF--
+<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?>
+--FILE--
+<?php
+$pdo = new PDO('sqlite::memory:');
+var_dump($pdo->getAttribute(PDO::ATTR_SERVER_VERSION));
+var_dump($pdo->getAttribute(PDO::ATTR_CLIENT_VERSION));
+
+?>
+--EXPECTF--
+string(%d) "%s"
+string(%d) "%s"