test_fetch_object.phpt [plain text]
--TEST--
Sybase-CT sybase_fetch_object
--SKIPIF--
<?php
require('skipif.inc');
?>
--FILE--
<?php
require('test.inc');
class article { }
function fetch_object($db, $arg= NULL) {
return sybase_fetch_object(sybase_query('select
1 as "id",
"Hello" as "caption",
"timm" as "author",
getdate() as "lastchange"
', $db), $arg);
}
$db= sybase_connect_ex();
var_export(fetch_object($db)); echo "\n";
var_export(fetch_object($db, 'article')); echo "\n";
var_export(fetch_object($db, new article())); echo "\n";
var_export(fetch_object($db, '***')); echo "\n";
sybase_close($db);
?>
--EXPECTF--
stdClass::__set_state(array(
'id' => 1,
'caption' => 'Hello',
'author' => 'timm',
'lastchange' => '%s',
))
article::__set_state(array(
'id' => 1,
'caption' => 'Hello',
'author' => 'timm',
'lastchange' => '%s',
))
article::__set_state(array(
'id' => 1,
'caption' => 'Hello',
'author' => 'timm',
'lastchange' => '%s',
))
Notice: sybase_fetch_object(): Sybase: Class *** has not been declared in %stest_fetch_object.php on line %d
stdClass::__set_state(array(
'id' => 1,
'caption' => 'Hello',
'author' => 'timm',
'lastchange' => '%s',
))