rewrite unit test for scenario
This commit is contained in:
parent
9e5489a98c
commit
53a7cfb86c
64 changed files with 229 additions and 548 deletions
31
scenario/HTML/test_postgres_json_array.php
Normal file
31
scenario/HTML/test_postgres_json_array.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
//@description: test pour PostgreSQL JSON & ARRAY
|
||||
$cnx=$cn->get_db();
|
||||
|
||||
$ret = pg_query($cnx,"select * from jrn_def ");
|
||||
|
||||
$result=pg_fetch_all($ret);
|
||||
|
||||
echo "retrieve ",count($result);
|
||||
|
||||
$ret=pg_query($cnx,"drop table if exists public.test_array_int");
|
||||
|
||||
$ret = pg_query ($cnx,
|
||||
"CREATE TABLE public.test_array_int(
|
||||
ac_id serial4 NOT NULL PRIMARY KEY ,
|
||||
ac_label text NOT NULL,
|
||||
ac_rate numeric(5, 2) NOT NULL,
|
||||
ajrn_def_id _int4 NULL); "
|
||||
);
|
||||
if ( ! $ret ){
|
||||
die ("cannot create public.test_array_int");
|
||||
}
|
||||
$ret=pg_query($cnx,
|
||||
"insert into public.test_array_int(ac_label,ac_rate,ajrn_def_id) values ('ligne 1',1.2,'{1,2}')");
|
||||
|
||||
$ret=pg_query_params($cnx,
|
||||
"insert into public.test_array_int(ac_label,ac_rate,ajrn_def_id) values ($1,$2,$3)",
|
||||
array('ligne 1',1.2,'{1,2}'));
|
||||
|
||||
|
||||
$ret=pg_query($cnx,"drop table if exists public.test_array_int");
|
||||
Loading…
Add table
Add a link
Reference in a new issue