1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/pgsql/tests/gh8253.phpt
KentarouTakeda c15988aab3 ext/pgsql: Refactor tests (#12608)
This makes the tests independent of each other and allows them to be run in parallel.

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2023-11-06 22:36:52 +00:00

40 lines
703 B
PHP

--TEST--
pg_insert() fails for references
--EXTENSIONS--
pgsql
--SKIPIF--
<?php
include("inc/skipif.inc");
?>
--FILE--
<?php
include "inc/config.inc";
$table_name = 'table_gh8253';
function fee(&$a) {}
$a = ["bar" => "testing"];
fee($a["bar"]);
$db = pg_connect($conn_str);
pg_query($db, "CREATE TABLE {$table_name} (bar text);");
pg_insert($db, $table_name, $a);
$res = pg_query($db, "SELECT * FROM {$table_name}");
var_dump(pg_fetch_all($res));
?>
--CLEAN--
<?php
require_once('inc/config.inc');
$table_name = 'table_gh8253';
$db = pg_connect($conn_str);
pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
?>
--EXPECT--
array(1) {
[0]=>
array(1) {
["bar"]=>
string(7) "testing"
}
}