Development

#3488: patch_for_3488.patch

You must first sign up to be able to contribute.

Ticket #3488: patch_for_3488.patch

File patch_for_3488.patch, 2.1 kB (added by FabianLange, 8 months ago)

possible fix, but side effect on time zones order

  • lib/i18n/sfCultureInfo.class.php

    old new  
    360360      { 
    361361        if ($merge) 
    362362        { 
    363           $result = array_merge($info, $result); 
     363          $result = sfToolkit::arrayDeepMerge($info, $result); 
    364364        } 
    365365        else 
    366366        { 
  • test/unit/i18n/sfCultureInfoTest.php

    old new  
    1010 
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(56, new lime_output_color()); 
     13$t = new lime_test(57, new lime_output_color()); 
    1414 
    1515// __construct() 
    1616$t->diag('__construct()'); 
     
    7575$t->diag('->getTimeZones()'); 
    7676$time_zones_en = $c_en->getTimeZones(); 
    7777$time_zones_fr = $c_fr->getTimeZones(); 
    78 $t->is($time_zones_en[1][0], 'America/Los_Angeles', '->getTimeZones() returns a list of time zones in the language of the localized version'); 
    79 $t->is($time_zones_fr[1][0], 'America/Vancouver', '->getTimeZones() returns a list of time zones in the language of the localized version'); 
     78$t->is($time_zones_fr[1][0], 'America/Los_Angeles', '->getTimeZones() returns a list of time zones in the language of the localized version'); 
     79$t->is($time_zones_en[1][0], 'America/Vancouver', '->getTimeZones() returns a list of time zones in the language of the localized version'); 
    8080$t->is($time_zones_en, $c_en->TimeZones, '->getTimeZones() is equivalent to ->TimeZones'); 
    8181 
    8282// ->validCulture() 
     
    176176$c->DateTimeFormat = 'mm'; 
    177177$t->is($c->getDateTimeFormat(), 'mm', '->setDateTimeFormat() is equivalent to ->DateTimeFormat = '); 
    178178 
     179// regression test for http://trac.symfony-project.com/ticket/3488 
     180$c = new sfCultureInfo('zh_HK'); 
     181$t->is(count($c->getDateTimeFormat()->getMonthNames()), 12, '->getMonthNames returns 12 month names for zh_HK locale (see #3488).'); 
     182 
    179183// ->getNumberFormat() 
    180184$t->diag('->getNumberFormat()'); 
    181185$c = new sfCultureInfo();