~ubuntu-branches/ubuntu/lucid/php5/lucid

« back to all changes in this revision

Viewing changes to ext/intl/tests/resourcebundle_individual.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-03-16 09:09:50 UTC
  • mfrom: (1.1.18 upstream) (0.3.10 sid)
  • Revision ID: james.westby@ubuntu.com-20100316090950-e36m0pzranoixifd
Tags: 5.3.2-1ubuntu1
* Merge from debian unstable: 
  - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions already in
      universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
  - Dropped debian/patches/libedit_is_editline.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Test ResourceBundle::get() and length() - existing/missing keys
 
3
--FILE--
 
4
<?php
 
5
        include "resourcebundle.inc";
 
6
 
 
7
function ut_main() {
 
8
        $str_res = '';
 
9
        // fall back
 
10
        $r = ut_resourcebundle_create( 'en_US', BUNDLE );
 
11
 
 
12
        $str_res .= sprintf( "length: %d\n", ut_resourcebundle_count($r) );
 
13
        $str_res .= sprintf( "teststring: %s\n", ut_resourcebundle_get($r,  'teststring' ) );
 
14
        $str_res .= sprintf( "testint: %d\n", ut_resourcebundle_get($r, 'testint' ) );
 
15
 
 
16
        $str_res .= print_r( ut_resourcebundle_get($r, 'testvector' ), true );
 
17
 
 
18
        $str_res .= sprintf( "testbin: %s\n", bin2hex(ut_resourcebundle_get( $r,'testbin' )) );
 
19
 
 
20
        $r2 = ut_resourcebundle_get($r, 'testtable' );
 
21
        $str_res .= sprintf( "testtable: %d\n", ut_resourcebundle_get($r2, 'major' ) );
 
22
 
 
23
        $r2 = ut_resourcebundle_get($r,'testarray' );
 
24
        $str_res .= sprintf( "testarray: %s\n", ut_resourcebundle_get($r2, 2 ) );
 
25
 
 
26
        $t = ut_resourcebundle_get( $r, 'nonexisting' );
 
27
        $str_res .= debug( $t );
 
28
        
 
29
        return $str_res;
 
30
}
 
31
        include_once( 'ut_common.inc' );
 
32
        ut_run();
 
33
?>
 
34
--EXPECT--
 
35
length: 6
 
36
teststring: Hello World!
 
37
testint: 2
 
38
Array
 
39
(
 
40
    [0] => 1
 
41
    [1] => 2
 
42
    [2] => 3
 
43
    [3] => 4
 
44
    [4] => 5
 
45
    [5] => 6
 
46
    [6] => 7
 
47
    [7] => 8
 
48
    [8] => 9
 
49
    [9] => 0
 
50
)
 
51
testbin: a1b2c3d4e5f67890
 
52
testtable: 3
 
53
testarray: string 3
 
54
NULL
 
55
    2: Cannot load resource element 'nonexisting': U_MISSING_RESOURCE_ERROR