Annotation of embedaddon/php/ext/intl/tests/collator_get_set_attribute.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: get/set_attribute()
3: --SKIPIF--
4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5: --FILE--
6: <?php
7:
8: /*
9: * Try to set/get a collation attribute.
10: */
11:
12:
13: /*
14: * Return current normalication mode.
15: */
16: function check_val( $coll )
17: {
18: $val = ut_coll_get_attribute( $coll, Collator::NORMALIZATION_MODE );
19: return sprintf( "%s\n", ( $val == Collator::OFF ? "off" : "on" ) );
20: }
21:
22: function ut_main()
23: {
24: $res = '';
25: $coll = ut_coll_create( 'en_US' );
26:
27: ut_coll_set_attribute( $coll, Collator::NORMALIZATION_MODE, Collator::OFF );
28: $res .= check_val( $coll );
29:
30: ut_coll_set_attribute( $coll, Collator::NORMALIZATION_MODE, Collator::ON );
31: $res .= check_val( $coll );
32:
33: return $res;
34: }
35:
36: include( 'ut_common.inc' );
37: ut_run();
38: ?>
39: --EXPECT--
40: off
41: on
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>