php-src/ext/pgsql/tests/bug64609.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

35 lines
653 B
PHP

--TEST--
Bug #64609 (pg_convert enum type support)
--EXTENSIONS--
pgsql
--SKIPIF--
<?php
include("inc/skipif.inc");
skip_server_version('8.3', '<');
?>
--FILE--
<?php
error_reporting(E_ALL);
include 'inc/config.inc';
$table_name = 'table_bug64609';
$type_name = 'type_bug64609';
$db = pg_connect($conn_str);
pg_query($db, "BEGIN");
pg_query($db, "CREATE TYPE {$type_name} AS ENUM ('ok', 'ko')");
pg_query($db, "CREATE TABLE {$table_name} (a {$type_name})");
$fields = array('a' => 'ok');
$converted = pg_convert($db, $table_name, $fields);
pg_query($db, "ROLLBACK");
var_dump($converted);
?>
--EXPECT--
array(1) {
[""a""]=>
string(5) "E'ok'"
}