From: Antony Dovgal Date: Sat, 7 Jun 2008 14:10:42 +0000 (+0000) Subject: add more tests (Felipe) X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c80f146f8135f994a6a42ea95dd06d23cb5787fb;p=php add more tests (Felipe) --- diff --git a/ext/spl/tests/fastarray_005.phpt b/ext/spl/tests/fastarray_005.phpt new file mode 100644 index 0000000000..0e6132ad39 --- /dev/null +++ b/ext/spl/tests/fastarray_005.phpt @@ -0,0 +1,12 @@ +--TEST-- +SPL: FastArray: Trying to instantiate passing object to constructor parameter +--FILE-- + +--EXPECTF-- +Warning: SplFastArray::__construct() expects parameter 1 to be long, object given in %s on line %d diff --git a/ext/spl/tests/fastarray_006.phpt b/ext/spl/tests/fastarray_006.phpt new file mode 100644 index 0000000000..f9a4e59616 --- /dev/null +++ b/ext/spl/tests/fastarray_006.phpt @@ -0,0 +1,22 @@ +--TEST-- +SPL: FastArray: Assigning objects +--FILE-- +getMessage(), "\n"; +} + +print "ok\n"; + +?> +--EXPECT-- +Index invalid or out of range +ok diff --git a/ext/spl/tests/fastarray_007.phpt b/ext/spl/tests/fastarray_007.phpt new file mode 100644 index 0000000000..4cc46fee92 --- /dev/null +++ b/ext/spl/tests/fastarray_007.phpt @@ -0,0 +1,26 @@ +--TEST-- +SPL: FastArray: Assigning the itself object +--FILE-- +getMessage(), "\n"; +} + +foreach ($a as $c) { + if ($c) { + echo $c->getSize(), "\n"; + } +} + +print "ok\n"; + +?> +--EXPECT-- +10 +ok diff --git a/ext/spl/tests/fastarray_008.phpt b/ext/spl/tests/fastarray_008.phpt new file mode 100644 index 0000000000..05986a2cfe --- /dev/null +++ b/ext/spl/tests/fastarray_008.phpt @@ -0,0 +1,30 @@ +--TEST-- +SPL: FastArray: Assigning the itself object testing the reference +--FILE-- +getSize()); + +?> +--EXPECT-- +int(3) +int(2) +int(3) +int(3) diff --git a/ext/spl/tests/fastarray_009.phpt b/ext/spl/tests/fastarray_009.phpt new file mode 100644 index 0000000000..daead117cc --- /dev/null +++ b/ext/spl/tests/fastarray_009.phpt @@ -0,0 +1,10 @@ +--TEST-- +SPL: FastArray: Trying to instantiate passing string to construtor parameter +--FILE-- + +--EXPECTF-- +Warning: SplFastArray::__construct() expects parameter 1 to be long, string given in %s on line %d diff --git a/ext/spl/tests/fastarray_010.phpt b/ext/spl/tests/fastarray_010.phpt new file mode 100644 index 0000000000..dcb2e81b1b --- /dev/null +++ b/ext/spl/tests/fastarray_010.phpt @@ -0,0 +1,16 @@ +--TEST-- +SPL: FastArray: Setting size to 0 +--FILE-- +setSize(0); + +print "ok\n"; + +?> +--EXPECT-- +ok diff --git a/ext/spl/tests/fastarray_011.phpt b/ext/spl/tests/fastarray_011.phpt new file mode 100644 index 0000000000..746e05f24e --- /dev/null +++ b/ext/spl/tests/fastarray_011.phpt @@ -0,0 +1,14 @@ +--TEST-- +SPL: FastArray: Testing setSize() with NULL +--FILE-- +setSize(NULL); + +print "ok\n"; + +?> +--EXPECT-- +ok diff --git a/ext/spl/tests/fastarray_012.phpt b/ext/spl/tests/fastarray_012.phpt new file mode 100644 index 0000000000..d5592f1dbc --- /dev/null +++ b/ext/spl/tests/fastarray_012.phpt @@ -0,0 +1,19 @@ +--TEST-- +SPL: FastArray: Assigning the object to another variable using [] +--FILE-- +getMessage(), "\n"; +} + +print "ok\n"; + +?> +--EXPECT-- +Index invalid or out of range +ok diff --git a/ext/spl/tests/fastarray_013.phpt b/ext/spl/tests/fastarray_013.phpt new file mode 100644 index 0000000000..edc53d9f45 --- /dev/null +++ b/ext/spl/tests/fastarray_013.phpt @@ -0,0 +1,21 @@ +--TEST-- +SPL: FastArray: Passing the object using [] as parameter +--FILE-- +getMessage(), "\n"; +} + +?> +--EXPECT-- +Index invalid or out of range diff --git a/ext/spl/tests/fastarray_014.phpt b/ext/spl/tests/fastarray_014.phpt new file mode 100644 index 0000000000..dfb45b37b7 --- /dev/null +++ b/ext/spl/tests/fastarray_014.phpt @@ -0,0 +1,15 @@ +--TEST-- +SPL: FastArray: Trying to access inexistent item +--FILE-- +getMessage(); +} + +?> +--EXPECT-- +Index invalid or out of range