1--TEST--
2get/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 */
16function 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
23function 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
35include_once( 'ut_common.inc' );
36ut_run();
37?>
38--EXPECT--
39ok
40ok
41ok
42