PageRenderTime 46ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/bad/ext/intl/tests/resourcebundle_create.php

http://github.com/facebook/hiphop-php
PHP | 35 lines | 22 code | 8 blank | 5 comment | 0 complexity | eba8083da78135aeedb5a0496e5cc9d4 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. include "resourcebundle.inc";
  3. function ut_main() {
  4. $str_res = '';
  5. // all fine
  6. $r1 = ut_resourcebundle_create( 'root', BUNDLE );
  7. $str_res .= debug( $r1 );
  8. $str_res .= print_r( $r1['teststring'], true)."\n";
  9. // non-root one
  10. $r1 = ut_resourcebundle_create( 'es', BUNDLE );
  11. $str_res .= debug( $r1 );
  12. $str_res .= print_r( $r1['teststring'], true)."\n";
  13. // fall back
  14. $r1 = ut_resourcebundle_create( 'en_US', BUNDLE );
  15. $str_res .= debug( $r1 );
  16. $str_res .= print_r( $r1['testsring'], true);
  17. // fall out
  18. $r2 = ut_resourcebundle_create( 'en_US', BUNDLE, false );
  19. $str_res .= debug( $r2 );
  20. // missing
  21. $r3 = ut_resourcebundle_create( 'en_US', 'nonexisting' );
  22. $str_res .= debug( $r3 );
  23. return $str_res;
  24. }
  25. include_once( 'ut_common.inc' );
  26. ut_run();
  27. ?>