php-src/ext/sqlite/tests/sqlite_oo_030.phpt
Marcus Boerger bf9a25d0bb - Fix test expectations - we are no detecting the error earlier
# Unfortunatley we also lower the severity here because sqlite's error
# facility is dealing with the problem at this early stage as E_WARNING.
2005-11-03 23:48:09 +00:00

45 lines
992 B
PHP
Executable File

--TEST--
sqlite-oo: calling static methods
--INI--
sqlite.assoc_case=0
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded("sqlite")) print "skip";
?>
--FILE--
<?php
require_once('blankdb_oo.inc');
class foo {
static function bar($param = NULL) {
return $param;
}
}
function baz($param = NULL) {
return $param;
}
var_dump($db->singleQuery("select php('baz')", 1));
var_dump($db->singleQuery("select php('baz', 1)", 1));
var_dump($db->singleQuery("select php('baz', \"PHP\")", 1));
var_dump($db->singleQuery("select php('foo::bar')", 1));
var_dump($db->singleQuery("select php('foo::bar', 1)", 1));
var_dump($db->singleQuery("select php('foo::bar', \"PHP\")", 1));
var_dump($db->singleQuery("select php('foo::bar(\"PHP\")')", 1));
?>
===DONE===
--EXPECTF--
NULL
string(1) "1"
string(3) "PHP"
NULL
string(1) "1"
string(3) "PHP"
Warning: SQLiteDatabase::singleQuery(): function `foo::bar("PHP")' is not a function name in %ssqlite_oo_030.php on line %d
bool(false)
===DONE===