diff options
Diffstat (limited to 'ext/sybase_ct/tests')
| -rw-r--r-- | ext/sybase_ct/tests/bug30312.phpt | 6 | ||||
| -rw-r--r-- | ext/sybase_ct/tests/test.inc | 7 | ||||
| -rw-r--r-- | ext/sybase_ct/tests/test_fetch_object.phpt | 50 | ||||
| -rw-r--r-- | ext/sybase_ct/tests/test_fields.phpt | 72 | ||||
| -rw-r--r-- | ext/sybase_ct/tests/test_msghandler_handled.phpt | 5 |
5 files changed, 71 insertions, 69 deletions
diff --git a/ext/sybase_ct/tests/bug30312.phpt b/ext/sybase_ct/tests/bug30312.phpt index a7b02a622..c71a39e86 100644 --- a/ext/sybase_ct/tests/bug30312.phpt +++ b/ext/sybase_ct/tests/bug30312.phpt @@ -6,7 +6,7 @@ Sybase-CT bug #30312 (sybase_unbuffered_query calls) <?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug30312.phpt,v 1.1 2005/02/06 11:58:53 thekid Exp $ + * $Id: bug30312.phpt,v 1.1.4.1 2007/03/14 11:46:06 thekid Exp $ */ require('test.inc'); @@ -23,5 +23,5 @@ Sybase-CT bug #30312 (sybase_unbuffered_query calls) var_dump($array[0]); ?> --EXPECTF-- -string(%d) "%s %d %d %d:%d%s" -string(%d) "%s %d %d %d:%d%s" +string(%d) "%s %d %d %d:%d%s" +string(%d) "%s %d %d %d:%d%s" diff --git a/ext/sybase_ct/tests/test.inc b/ext/sybase_ct/tests/test.inc index daf33007a..ebd399a25 100644 --- a/ext/sybase_ct/tests/test.inc +++ b/ext/sybase_ct/tests/test.inc @@ -1,7 +1,7 @@ <?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test.inc,v 1.4 2004/02/10 20:39:08 thekid Exp $ + * $Id: test.inc,v 1.4.6.2 2007/03/11 12:56:44 tony2001 Exp $ */ // Change if needed @@ -28,7 +28,7 @@ // {{{ public static bool static_handler(int msgnumber, int severity, int state, int line, string text) // Handles server messages - function static_handler($msgnumber, $severity, $state, $line, $text) { + static function static_handler($msgnumber, $severity, $state, $line, $text) { return sybase_msg_handler($msgnumber, $severity, $state, $line, $text); } // }}} @@ -78,7 +78,8 @@ // {{{ mixed sybase_select_single(resource dbh, string query) // Fires an SQL query and returns the first value from the first row function sybase_select_single($dbh, $query) { - return array_shift(sybase_fetch_row(sybase_query($query, $dbh))); + $a = sybase_fetch_row(sybase_query($query, $dbh)); + return array_shift($a); } // }}} ?> diff --git a/ext/sybase_ct/tests/test_fetch_object.phpt b/ext/sybase_ct/tests/test_fetch_object.phpt index 0393967b9..a3255b33d 100644 --- a/ext/sybase_ct/tests/test_fetch_object.phpt +++ b/ext/sybase_ct/tests/test_fetch_object.phpt @@ -8,7 +8,7 @@ Sybase-CT sybase_fetch_object <?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_fetch_object.phpt,v 1.1 2004/07/11 16:10:03 thekid Exp $ + * $Id: test_fetch_object.phpt,v 1.1.6.1 2007/03/14 11:44:24 thekid Exp $ */ require('test.inc'); @@ -46,29 +46,29 @@ Sybase-CT sybase_fetch_object sybase_close($db); ?> --EXPECTF-- -class stdClass { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} -class article { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} -class article { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} +stdClass::__set_state(array( + 'id' => 1, + 'caption' => 'Hello', + 'author' => 'timm', + 'lastchange' => '%s', +)) +article::__set_state(array( + 'id' => 1, + 'caption' => 'Hello', + 'author' => 'timm', + 'lastchange' => '%s', +)) +article::__set_state(array( + 'id' => 1, + 'caption' => 'Hello', + 'author' => 'timm', + 'lastchange' => '%s', +)) Notice: sybase_fetch_object(): Sybase: Class *** has not been declared in %s/test_fetch_object.php on line %d -class stdClass { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} +stdClass::__set_state(array( + 'id' => 1, + 'caption' => 'Hello', + 'author' => 'timm', + 'lastchange' => '%s', +)) diff --git a/ext/sybase_ct/tests/test_fields.phpt b/ext/sybase_ct/tests/test_fields.phpt index 5356751c2..eef941148 100644 --- a/ext/sybase_ct/tests/test_fields.phpt +++ b/ext/sybase_ct/tests/test_fields.phpt @@ -6,7 +6,7 @@ Sybase-CT sybase_field_* functions <?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_fields.phpt,v 1.1 2004/07/12 20:26:53 thekid Exp $ + * $Id: test_fields.phpt,v 1.1.6.1 2007/03/14 11:44:24 thekid Exp $ */ require('test.inc'); @@ -38,39 +38,39 @@ Sybase-CT sybase_field_* functions --EXPECTF-- resource(%d) of type (sybase-ct result) int(4) -class stdClass { - %s $name = 'id'; - %s $max_length = 11; - %s $column_source = ''; - %s $numeric = 1; - %s $type = 'int'; -} -class stdClass { - %s $name = 'caption'; - %s $max_length = 5; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} -class stdClass { - %s $name = 'author'; - %s $max_length = 4; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} -class stdClass { - %s $name = 'lastchange'; - %s $max_length = 29; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'datetime'; -} +stdClass::__set_state(array( + 'name' => 'id', + 'max_length' => 11, + 'column_source' => '', + 'numeric' => 1, + 'type' => 'int', +)) +stdClass::__set_state(array( + 'name' => 'caption', + 'max_length' => 5, + 'column_source' => '', + 'numeric' => 0, + 'type' => 'string', +)) +stdClass::__set_state(array( + 'name' => 'author', + 'max_length' => 4, + 'column_source' => '', + 'numeric' => 0, + 'type' => 'string', +)) +stdClass::__set_state(array( + 'name' => 'lastchange', + 'max_length' => 29, + 'column_source' => '', + 'numeric' => 0, + 'type' => 'datetime', +)) bool(true) -class stdClass { - %s $name = 'caption'; - %s $max_length = 5; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} +stdClass::__set_state(array( + 'name' => 'caption', + 'max_length' => 5, + 'column_source' => '', + 'numeric' => 0, + 'type' => 'string', +)) diff --git a/ext/sybase_ct/tests/test_msghandler_handled.phpt b/ext/sybase_ct/tests/test_msghandler_handled.phpt index 67d1c1293..70aa75d14 100644 --- a/ext/sybase_ct/tests/test_msghandler_handled.phpt +++ b/ext/sybase_ct/tests/test_msghandler_handled.phpt @@ -6,7 +6,7 @@ Sybase-CT server message handler <?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_msghandler_handled.phpt,v 1.1 2004/07/11 16:07:07 thekid Exp $ + * $Id: test_msghandler_handled.phpt,v 1.1.6.1 2007/03/14 11:57:45 thekid Exp $ */ require('test.inc'); @@ -20,6 +20,7 @@ Sybase-CT server message handler return; case 174: // The function 'GETDATE' requires 0 arguments. + case 11021: // Function GETDATE invoked with wrong number or type of argument(s) printf("*** Caught '%s'\n", trim($text)); return; } @@ -45,7 +46,7 @@ Sybase-CT server message handler --EXPECTF-- bool(true) >>> Query: select getdate(NULL) -*** Caught 'The function 'GETDATE' requires 0 arguments.' +*** Caught '%s' <<< Return: boolean bool(false) >>> Query: print "Hi" |
