Annotation of embedaddon/php/ext/sybase_ct/tests/bug43578.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Sybase-CT bug #43578 (Incurred fault #6 - if returned textfield ist empty)
! 3: --SKIPIF--
! 4: <?php require('skipif.inc'); ?>
! 5: --FILE--
! 6: <?php
! 7: /* This file is part of PHP test framework for ext/sybase_ct
! 8: *
! 9: * $Id: bug43578.phpt 268629 2008-11-09 10:44:03Z thekid $
! 10: */
! 11:
! 12: require('test.inc');
! 13:
! 14: $db= sybase_connect_ex();
! 15:
! 16: // Create a temporary table and fill it with test values
! 17: var_dump(sybase_query('
! 18: create table #Resource (
! 19: Resource_ID int,
! 20: DC_Rights text null
! 21: )
! 22: ', $db));
! 23: var_dump(sybase_query('insert into #Resource values (123, NULL)', $db));
! 24: var_dump(sybase_query('insert into #Resource values (124, "")', $db));
! 25:
! 26: // Select non-existant
! 27: var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 122'));
! 28:
! 29: // Select null
! 30: var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 123'));
! 31:
! 32: // Select empty
! 33: var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 124'));
! 34:
! 35: // Clean up and close connection
! 36: var_dump(sybase_query('drop table #Resource', $db));
! 37: sybase_close($db);
! 38: ?>
! 39: --EXPECTF--
! 40: bool(true)
! 41: bool(true)
! 42: bool(true)
! 43: >>> Query: select DC_Rights from #Resource where Resource_ID = 122
! 44: <<< Return: resource
! 45: array(0) {
! 46: }
! 47: >>> Query: select DC_Rights from #Resource where Resource_ID = 123
! 48: <<< Return: resource
! 49: array(1) {
! 50: [0]=>
! 51: array(1) {
! 52: ["DC_Rights"]=>
! 53: NULL
! 54: }
! 55: }
! 56: >>> Query: select DC_Rights from #Resource where Resource_ID = 124
! 57: <<< Return: resource
! 58: array(1) {
! 59: [0]=>
! 60: array(1) {
! 61: ["DC_Rights"]=>
! 62: string(1) " "
! 63: }
! 64: }
! 65: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>