Annotation of embedaddon/php/ext/pgsql/tests/pg_insert_001.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: PostgreSQL pg_select() - basic test using schema
! 3: --SKIPIF--
! 4: <?php include("skipif.inc"); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: include('config.inc');
! 9:
! 10: $conn = pg_connect($conn_str);
! 11:
! 12: pg_query('CREATE SCHEMA phptests');
! 13: pg_query('CREATE TABLE phptests.foo (id INT, id2 INT)');
! 14:
! 15:
! 16: pg_insert($conn, 'foo', array('id' => 1, 'id2' => 1));
! 17:
! 18: pg_insert($conn, 'phptests.foo', array('id' => 1, 'id2' => 2));
! 19:
! 20: var_dump(pg_insert($conn, 'phptests.foo', array('id' => 1, 'id2' => 2), PGSQL_DML_STRING));
! 21:
! 22: var_dump(pg_select($conn, 'phptests.foo', array('id' => 1)));
! 23:
! 24: pg_query('DROP TABLE phptests.foo');
! 25: pg_query('DROP SCHEMA phptests');
! 26:
! 27: ?>
! 28: --EXPECTF--
! 29:
! 30: Warning: pg_insert(): Table 'foo' doesn't exists in %s on line %d
! 31: string(47) "INSERT INTO phptests.foo (id,id2) VALUES (1,2);"
! 32: array(1) {
! 33: [0]=>
! 34: array(2) {
! 35: ["id"]=>
! 36: string(1) "1"
! 37: ["id2"]=>
! 38: string(1) "2"
! 39: }
! 40: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>