diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-19 09:26:21 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-19 09:26:21 +0100 |
commit | bd178a01c3c87fc392eeb8b7ebf3692dfc1fc964 (patch) | |
tree | 88d4bc272d25d66321793ec5e5078fd3a2fabb2a /tests/php/phpt/valueiterator | |
parent | 4555e0719a2766e165e0a3774c26728152fb30cc (diff) | |
parent | 778561e1739a4a7ef20e85b713b4790e6be225d3 (diff) |
Merge branch 'master' of https://github.com/CopernicaMarketingSoftware/PHP-CPP
Diffstat (limited to 'tests/php/phpt/valueiterator')
-rw-r--r-- | tests/php/phpt/valueiterator/001.phpt | 22 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/002.phpt | 22 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/003.phpt | 18 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/004.phpt | 20 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/005.phpt | 19 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/006.phpt | 21 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/readme | 1 |
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 |