mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

This also fixes skipped tests due to different naming "zend-test" instead of "zend_test" and "PDO" instead of "pdo": - ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt - ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt - ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt - ext/zend_test/tests/observer_sqlite_create_function.phpt EXTENSIONS section is used for the Windows build to load the non-static extensions. Closes GH-13276
51 lines
902 B
PHP
51 lines
902 B
PHP
--TEST--
|
|
Observer: PDO::sqliteCreateFunction() can be observed
|
|
--EXTENSIONS--
|
|
zend_test
|
|
pdo
|
|
pdo_sqlite
|
|
--INI--
|
|
zend_test.observer.enabled=1
|
|
zend_test.observer.observe_all=1
|
|
--FILE--
|
|
<?php
|
|
|
|
function returnOne() {
|
|
return 1;
|
|
}
|
|
|
|
$db = new PDO('sqlite::memory:');
|
|
$db->sqliteCreateFunction('returnOne', 'returnOne', 0);
|
|
|
|
foreach ($db->query('SELECT returnOne()') as $row) {
|
|
var_dump($row);
|
|
}
|
|
|
|
echo 'Done' . PHP_EOL;
|
|
?>
|
|
--EXPECTF--
|
|
<!-- init '%s' -->
|
|
<file '%s'>
|
|
<!-- init PDO::__construct() -->
|
|
<PDO::__construct>
|
|
</PDO::__construct>
|
|
<!-- init PDO::sqliteCreateFunction() -->
|
|
<PDO::sqliteCreateFunction>
|
|
</PDO::sqliteCreateFunction>
|
|
<!-- init PDO::query() -->
|
|
<PDO::query>
|
|
<!-- init returnOne() -->
|
|
<returnOne>
|
|
</returnOne>
|
|
</PDO::query>
|
|
<!-- init var_dump() -->
|
|
<var_dump>
|
|
array(2) {
|
|
["returnOne()"]=>
|
|
int(1)
|
|
[0]=>
|
|
int(1)
|
|
}
|
|
</var_dump>
|
|
Done
|
|
</file '%s'>
|