From 94867739e39ab236a05836d675f0cb7656d5d5a3 Mon Sep 17 00:00:00 2001 From: Rodrigo Prado de Jesus Date: Sun, 13 Mar 2016 13:39:13 -0700 Subject: [PATCH 1/4] added test to basic strtok function --- TSRM/tests/strtok_basic_01.phpt | 21 +++++++++++++++++++++ test.sqlite | 0 2 files changed, 21 insertions(+) create mode 100644 TSRM/tests/strtok_basic_01.phpt create mode 100644 test.sqlite diff --git a/TSRM/tests/strtok_basic_01.phpt b/TSRM/tests/strtok_basic_01.phpt new file mode 100644 index 0000000000000..8e320bc9d70b1 --- /dev/null +++ b/TSRM/tests/strtok_basic_01.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test the basics to function strtok. +--CREDITS-- +Rodrigo Prado de Jesus +--FILE-- +"); + $tok = strtok(" \n\t"); +} +?> +--EXPECT-- +string(14) "Word=This
" +string(12) "Word=is
" +string(12) "Word=an
" +string(17) "Word=example
" +string(16) "Word=string
" diff --git a/test.sqlite b/test.sqlite new file mode 100644 index 0000000000000..e69de29bb2d1d From 3e079963807b4dfd51cadbc3a877801c01307ec2 Mon Sep 17 00:00:00 2001 From: Rodrigo Prado de Jesus Date: Sun, 13 Mar 2016 13:39:52 -0700 Subject: [PATCH 2/4] removed test incorrect --- test.sqlite | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test.sqlite diff --git a/test.sqlite b/test.sqlite deleted file mode 100644 index e69de29bb2d1d..0000000000000 From 68c23f82b6d5dbbe8d02f6de389d8fb818ce69a0 Mon Sep 17 00:00:00 2001 From: Rodrigo Prado de Jesus Date: Sun, 13 Mar 2016 14:06:19 -0700 Subject: [PATCH 3/4] added basic test function posix_getpwnam() --- ext/posix/tests/posix_getpwnam_basic_01.phpt | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ext/posix/tests/posix_getpwnam_basic_01.phpt diff --git a/ext/posix/tests/posix_getpwnam_basic_01.phpt b/ext/posix/tests/posix_getpwnam_basic_01.phpt new file mode 100644 index 0000000000000..12fe87ff2d85d --- /dev/null +++ b/ext/posix/tests/posix_getpwnam_basic_01.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test posix_getpwnam() function : basic functionality +--CREDITS-- +Rodrigo Prado de Jesus +--SKIPIF-- + +--FILE-- + +===DONE==== +--EXPECTREGEX-- +Array +\( + \[name\] => [^\r\n]+ + \[passwd\] => [^\r\n]+ + \[uid\] => [0-9]+ + \[gid\] => [0-9]+ + \[gecos\] => [^\r\n]* + \[dir\] => [^\r\n]+ + \[shell\] => [^\r\n]+ +\) +===DONE==== \ No newline at end of file From 00a984163c21c234bcfb2f7eec725722c95996c3 Mon Sep 17 00:00:00 2001 From: Rodrigo Prado de Jesus Date: Sun, 18 Jun 2017 23:14:55 -0300 Subject: [PATCH 4/4] addedsome tests to readline --- .../tests/readline_info_wrongparam_001.phpt | 15 +++++++++++++++ ext/readline/tests/readline_nullparam.phpt | 11 +++++++++++ .../readline_read_history_wrongparam_001.phpt | 14 ++++++++++++++ ext/readline/tests/readline_wrongparam_001.phpt | 14 ++++++++++++++ ext/readline/tests/readline_wrongparam_002.phpt | 13 +++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 ext/readline/tests/readline_info_wrongparam_001.phpt create mode 100644 ext/readline/tests/readline_nullparam.phpt create mode 100644 ext/readline/tests/readline_read_history_wrongparam_001.phpt create mode 100644 ext/readline/tests/readline_wrongparam_001.phpt create mode 100644 ext/readline/tests/readline_wrongparam_002.phpt diff --git a/ext/readline/tests/readline_info_wrongparam_001.phpt b/ext/readline/tests/readline_info_wrongparam_001.phpt new file mode 100644 index 0000000000000..f2185795a6ef4 --- /dev/null +++ b/ext/readline/tests/readline_info_wrongparam_001.phpt @@ -0,0 +1,15 @@ +--TEST-- +Test readline_info function : wrong parameter (array) +- line 248 from readline.c +--CREDITS-- +Rodrigo Prado de Jesus +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: readline_info() expects parameter 1 to be string, array given in %s on line %d diff --git a/ext/readline/tests/readline_nullparam.phpt b/ext/readline/tests/readline_nullparam.phpt new file mode 100644 index 0000000000000..c8b9b3a3ace28 --- /dev/null +++ b/ext/readline/tests/readline_nullparam.phpt @@ -0,0 +1,11 @@ +--TEST-- +Test the function readline with null parameter (wrong because the function expects a string parameter). +--CREDITS-- +Rodrigo Prado de Jesus +--SKIPIF-- + +--FILE-- + +--EXPECTF-- diff --git a/ext/readline/tests/readline_read_history_wrongparam_001.phpt b/ext/readline/tests/readline_read_history_wrongparam_001.phpt new file mode 100644 index 0000000000000..974516d8489a5 --- /dev/null +++ b/ext/readline/tests/readline_read_history_wrongparam_001.phpt @@ -0,0 +1,14 @@ +--TEST-- +Test readline_read_history function : wrong parameter (array) +- test line 412 from readline.c +--CREDITS-- +Rodrigo Prado de Jesus +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: readline_read_history() expects parameter 1 to be a valid path, array given in %s on line %d diff --git a/ext/readline/tests/readline_wrongparam_001.phpt b/ext/readline/tests/readline_wrongparam_001.phpt new file mode 100644 index 0000000000000..1f8eff23f4415 --- /dev/null +++ b/ext/readline/tests/readline_wrongparam_001.phpt @@ -0,0 +1,14 @@ +--TEST-- +Test readline function : wrong parameter (array) +- lines from 221 to 223 - readline.c +--CREDITS-- +Rodrigo Prado de Jesus +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: readline() expects parameter 1 to be string, array given in %s on line %d diff --git a/ext/readline/tests/readline_wrongparam_002.phpt b/ext/readline/tests/readline_wrongparam_002.phpt new file mode 100644 index 0000000000000..2c7d52beda77f --- /dev/null +++ b/ext/readline/tests/readline_wrongparam_002.phpt @@ -0,0 +1,13 @@ +--TEST-- +Check the function readline with 2 parameters (wrong because the function expects only one parameter). +- lines from 221 to 223 - readline.c +--CREDITS-- +Rodrigo Prado de Jesus +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: readline() expects at most 1 parameter, 2 given in %s on line %d