summaryrefslogtreecommitdiff
path: root/tests/php/phpt/valueiterator
diff options
context:
space:
mode:
Diffstat (limited to 'tests/php/phpt/valueiterator')
-rw-r--r--tests/php/phpt/valueiterator/001.phpt22
-rw-r--r--tests/php/phpt/valueiterator/002.phpt22
-rw-r--r--tests/php/phpt/valueiterator/003.phpt18
-rw-r--r--tests/php/phpt/valueiterator/004.phpt20
-rw-r--r--tests/php/phpt/valueiterator/005.phpt19
-rw-r--r--tests/php/phpt/valueiterator/006.phpt21
-rw-r--r--tests/php/phpt/valueiterator/readme1
7 files changed, 123 insertions, 0 deletions
diff --git a/tests/php/phpt/valueiterator/001.phpt b/tests/php/phpt/valueiterator/001.phpt
new file mode 100644
index 0000000..ae85e23
--- /dev/null
+++ b/tests/php/phpt/valueiterator/001.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Iterate array
+--DESCRIPTION--
+Iterate regular php array
+--SKIPIF--
+<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+require dirname(__FILE__) . '/../../include/valueiterator/1.php';
+
+$arr = array('qwe' => 'qweqweqweqw',5,'asd' => '«£¥§©®°±¶⅐⅒⅓⅘⅞Ⅻↆ❄❅❆⚑⚐⌛⌚〰»', 'zxccvx' => 'sdfsecvyh6bug6yfty',);
+
+TestValueIterator\loopValue($arr);
+
+echo PHP_EOL;
+--EXPECT--
+Array/Object contains 4 items
+[qwe]=qweqweqweqw
+[0]=5
+[asd]=«£¥§©®°±¶⅐⅒⅓⅘⅞Ⅻↆ❄❅❆⚑⚐⌛⌚〰»
+[zxccvx]=sdfsecvyh6bug6yfty
+
diff --git a/tests/php/phpt/valueiterator/002.phpt b/tests/php/phpt/valueiterator/002.phpt
new file mode 100644
index 0000000..59d5dad
--- /dev/null
+++ b/tests/php/phpt/valueiterator/002.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Iterate object of stdClass
+--DESCRIPTION--
+Iterate object of stdClass
+--SKIPIF--
+<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+require dirname(__FILE__) . '/../../include/valueiterator/1.php';
+
+$arr = array('qwe' => 'qweqweqweqw',5,'asd' => '«£¥§©®°±¶⅐⅒⅓⅘⅞Ⅻↆ❄❅❆⚑⚐⌛⌚〰»', 'zxccvx' => 'sdfsecvyh6bug6yfty',);
+$obj = (object)$arr;
+
+TestValueIterator\loopValue($obj);
+
+echo PHP_EOL;
+--EXPECT--
+Array/Object contains 0 items
+[qwe]=qweqweqweqw
+[0]=5
+[asd]=«£¥§©®°±¶⅐⅒⅓⅘⅞Ⅻↆ❄❅❆⚑⚐⌛⌚〰»
+[zxccvx]=sdfsecvyh6bug6yfty \ No newline at end of file
diff --git a/tests/php/phpt/valueiterator/003.phpt b/tests/php/phpt/valueiterator/003.phpt
new file mode 100644
index 0000000..4155a2d
--- /dev/null
+++ b/tests/php/phpt/valueiterator/003.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Iterate object
+--DESCRIPTION--
+Iterate regular php object
+--SKIPIF--
+<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+require dirname(__FILE__) . '/../../include/valueiterator/1.php';
+
+$smpl = new SimpleClass;
+
+TestValueIterator\loopValue($smpl);
+
+--EXPECT--
+Array/Object contains 0 items
+[cl0_float]=3.14
+[cl0_str1]=public str1 \ No newline at end of file
diff --git a/tests/php/phpt/valueiterator/004.phpt b/tests/php/phpt/valueiterator/004.phpt
new file mode 100644
index 0000000..3e6afb7
--- /dev/null
+++ b/tests/php/phpt/valueiterator/004.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Iterate itarable oblect
+--DESCRIPTION--
+class impIterator implements Iterator
+--SKIPIF--
+<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+require dirname(__FILE__) . '/../../include/valueiterator/1.php';
+
+$it = new impIterator;
+
+TestValueIterator\loopValue($it);
+
+--EXPECT--
+Array/Object contains 0 items
+[key_0]=firstElement
+[key_1]=secondElement
+[key_2]=lastelEment
+~impIterator \ No newline at end of file
diff --git a/tests/php/phpt/valueiterator/005.phpt b/tests/php/phpt/valueiterator/005.phpt
new file mode 100644
index 0000000..e5df91e
--- /dev/null
+++ b/tests/php/phpt/valueiterator/005.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Iterate itarable oblect
+--DESCRIPTION--
+class impIterAggr1 implements IteratorAggregate
+--SKIPIF--
+<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+require dirname(__FILE__) . '/../../include/valueiterator/1.php';
+
+$iag1 = new impIterAggr1;
+
+TestValueIterator\loopValue($iag1);
+
+--EXPECT--
+Array/Object contains 0 items
+[cl0_float]=3.14
+[cl0_str1]=public str1
+~impIterAggr1 \ No newline at end of file
diff --git a/tests/php/phpt/valueiterator/006.phpt b/tests/php/phpt/valueiterator/006.phpt
new file mode 100644
index 0000000..d31cdda
--- /dev/null
+++ b/tests/php/phpt/valueiterator/006.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Iterate itarable oblect
+--DESCRIPTION--
+class impIterAggr1 implements IteratorAggregate
+--SKIPIF--
+<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+require dirname(__FILE__) . '/../../include/valueiterator/1.php';
+
+$iag2 = new impIterAggr2;
+
+TestValueIterator\loopValue($iag2);
+
+--EXPECT--
+Array/Object contains 0 items
+[key_0]=firstElement
+[key_1]=secondElement
+[key_2]=lastelEment
+~impIterAggr2
+~impIterator \ No newline at end of file
diff --git a/tests/php/phpt/valueiterator/readme b/tests/php/phpt/valueiterator/readme
new file mode 100644
index 0000000..0156308
--- /dev/null
+++ b/tests/php/phpt/valueiterator/readme
@@ -0,0 +1 @@
+Tests of basic capabilities