[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/i18n/tests/cases/datetime/ -> lmbLocaleDateFormatTest.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  lmb_require('limb/i18n/src/datetime/lmbLocaleDate.class.php');
  10  lmb_require('limb/i18n/toolkit.inc.php');
  11  
  12  class lmbLocaleDateFormatTest extends UnitTestCase
  13  {
  14    function testFormatWithoutLocale()
  15    {
  16      $date = new lmbLocaleDate('2005-01-02 23:05:03');
  17      $string = $date->localeStrftime('%C %d %D %e %E %H %I %j %m %M %n %R %S %U %y %Y %t %%');
  18  
  19      $this->assertEqual($string, "20 02 01/02/05 2 2453373 23 11 002 01 05 \n 23:05 03 1 05 2005 \t %");
  20    }
  21  
  22    function testLocalizedFormat()
  23    {
  24      $date = new lmbLocaleDate('2005-01-20 10:15:30');
  25  
  26      $locale = new lmbLocale('en', new lmbIni(dirname(__FILE__) . '/../en.ini'));
  27  
  28      $res = $date->localeStrftime($locale->getDateFormat(), $locale);
  29  
  30      $expected = 'Thursday 20 January 2005';
  31      $this->assertEqual($res, $expected);
  32    }
  33  }
  34  ?>


Generated: Sat Nov 22 03:48:54 2008 Cross-referenced by PHPXref 0.7