Annotation of embedaddon/php/ext/intl/tests/collator_get_set_strength.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: get/set_strength()
! 3: --SKIPIF--
! 4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: /*
! 9: * Try to set/get collation strength.
! 10: */
! 11:
! 12: /*
! 13: * Set given collation strength, then get it back
! 14: * and check if it's the same.
! 15: */
! 16: function check_set_strength( $coll, $val )
! 17: {
! 18: ut_coll_set_strength( $coll, $val );
! 19: $new_val = ut_coll_get_strength( $coll );
! 20: return ( $new_val == $val ? "ok" : "failed" ) . "\n";
! 21: }
! 22:
! 23: function ut_main()
! 24: {
! 25: $res = '';
! 26: $coll = ut_coll_create( 'en_US' );
! 27:
! 28: $res .= check_set_strength( $coll, Collator::PRIMARY );
! 29: $res .= check_set_strength( $coll, Collator::SECONDARY );
! 30: $res .= check_set_strength( $coll, Collator::TERTIARY );
! 31:
! 32: return $res;
! 33: }
! 34:
! 35: include_once( 'ut_common.inc' );
! 36: ut_run();
! 37: ?>
! 38: --EXPECT--
! 39: ok
! 40: ok
! 41: ok
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>