Annotation of embedaddon/php/ext/intl/tests/locale_accept.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: locale_accept_from_http
        !             3: --SKIPIF--
        !             4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
        !             5: --FILE--
        !             6: <?php
        !             7: 
        !             8: /*
        !             9:  * Try parsing different Locales  
        !            10:  * with Procedural and Object methods.
        !            11:  */
        !            12: 
        !            13: function ut_main()
        !            14: {
        !            15:        $res_str = "";
        !            16:        $http_acc = array(
        !            17:                'en-us,en;q=0.5',
        !            18:                'da, en-gb;q=0.8, en;q=0.7',
        !            19:                'zh, en-us;q=0.8, en;q=0.7',
        !            20:                'xx, fr-FR;q=0.3, de-DE;q=0.5',
        !            21:                'none',
        !            22:                array()
        !            23:        );
        !            24: 
        !            25:      foreach($http_acc as $http) {
        !            26:                $res = ut_loc_accept_http($http);
        !            27:                $res_str .= "Accepting $http: $res\n";
        !            28:        }
        !            29: 
        !            30:     return $res_str;
        !            31: }
        !            32: 
        !            33: include_once( 'ut_common.inc' );
        !            34: ut_run();
        !            35: 
        !            36: ?>
        !            37: --EXPECTF--
        !            38: Warning: Locale::acceptFromHttp() expects parameter 1 to be string, array given in %s on line %d
        !            39: 
        !            40: Warning: locale_accept_from_http() expects parameter 1 to be string, array given in %s on line %d
        !            41: Accepting en-us,en;q=0.5: en_US
        !            42: Accepting da, en-gb;q=0.8, en;q=0.7: da
        !            43: Accepting zh, en-us;q=0.8, en;q=0.7: zh
        !            44: Accepting xx, fr-FR;q=0.3, de-DE;q=0.5: de_DE
        !            45: Accepting none: 
        !            46: Accepting Array:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>