diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/spl/tests/arrayObject_natcasesort_basic1.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/spl/tests/arrayObject_natcasesort_basic1.phpt')
-rw-r--r-- | ext/spl/tests/arrayObject_natcasesort_basic1.phpt | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/ext/spl/tests/arrayObject_natcasesort_basic1.phpt b/ext/spl/tests/arrayObject_natcasesort_basic1.phpt new file mode 100644 index 0000000..62ad2ed --- /dev/null +++ b/ext/spl/tests/arrayObject_natcasesort_basic1.phpt @@ -0,0 +1,56 @@ +--TEST-- +SPL: Test ArrayObject::natcasesort() function : basic functionality +--FILE-- +<?php +/* Prototype : int ArrayObject::natcasesort() + * Description: proto int ArrayIterator::natcasesort() + Sort the entries by values using case insensitive "natural order" algorithm. + * Source code: ext/spl/spl_array.c + * Alias to functions: + */ + +echo "*** Testing ArrayObject::natcasesort() : basic functionality ***\n"; + +$ao1 = new ArrayObject(array('boo10','boo1','boo2','boo22','BOO5')); +$ao2 = new ArrayObject(array('a'=>'boo10','b'=>'boo1','c'=>'boo2','d'=>'boo22','e'=>'BOO5')); +var_dump($ao1->natcasesort()); +var_dump($ao1); +var_dump($ao2->natcasesort('blah')); +var_dump($ao2); +?> +===DONE=== +--EXPECTF-- +*** Testing ArrayObject::natcasesort() : basic functionality *** +bool(true) +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + [1]=> + string(4) "boo1" + [2]=> + string(4) "boo2" + [4]=> + string(4) "BOO5" + [0]=> + string(5) "boo10" + [3]=> + string(5) "boo22" + } +} +bool(true) +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + ["b"]=> + string(4) "boo1" + ["c"]=> + string(4) "boo2" + ["e"]=> + string(4) "BOO5" + ["a"]=> + string(5) "boo10" + ["d"]=> + string(5) "boo22" + } +} +===DONE=== |