Permalink
Browse files

Unit tests adjusted and CHANGELOG line added.

  • Loading branch information...
1 parent c1c3c82 commit 156a568f7dfee945eb5191956d2c51401996c145 @resurtm committed Mar 9, 2013
Showing with 12 additions and 11 deletions.
  1. +1 −0 CHANGELOG
  2. +11 −11 tests/framework/utils/CDateTimeParserTest.php
View
@@ -24,6 +24,7 @@ Version 1.1.14 work in progress
- Enh #1948: Tidy up and improve html5 input support in CHtml and CActiveForm (phpnode)
- Enh #1977: CFormatter::normalizeDateValue() now is protected instead of private to enable child classes to override it (etienneq)
- Enh #2038: CFormatter::formatNtext() method can replace newlines with `<p></p>` not just with `<br />` as it was before (resurtm)
+- Enh #2119: CDateTimeParser: added 'y' pattern (4 year digit, e.g., 2005) (mrpelle, resurtm)
- Chg #645: CDbConnection now throws CDbException when failed to open DB connection instead of failing with a warning (kidol, eirikhm, samdark, cebe)
- Chg #1891: Changed order of methods in models generated by Gii and yiic, added better description of search method (hijarian, samdark)
- New #575: Yii registering at Packagist, added composer info file (schmunk42)
@@ -14,7 +14,7 @@ public function testAllPatterns()
);
$this->assertEquals(
'02 Aug, 2010, 05:09:07',
- date('d M, Y, H:i:s', CDateTimeParser::parse('2\AUG\2010, 5:09:07 Am, ZzZ', 'd\MMM\yyyy, H:mm:ss a, ???'))
+ date('d M, Y, H:i:s', CDateTimeParser::parse('2\AUG\2010, 5:09:07 Am, ZzZ', 'd\MMM\y, H:mm:ss a, ???'))
);
$this->assertEquals(
'02 Aug, 2010, 05:09:07',
@@ -31,7 +31,7 @@ public function testParseDefaults()
// test matching with wildcards, this example is mssql timestamp
$this->assertEquals(
'2011-02-10 23:43:04',
- date('Y-m-d H:i:s', CDateTimeParser::parse('2011-02-10 23:43:04.973', 'yyyy-MM-dd hh:mm:ss.???'))
+ date('Y-m-d H:i:s', CDateTimeParser::parse('2011-02-10 23:43:04.973', 'y-MM-dd hh:mm:ss.???'))
);
$this->assertEquals(
'2011-01-10 23:43:04',
@@ -47,7 +47,7 @@ public function testShortMonthTitle()
);
$this->assertEquals(
'05, 1991, 01:09, Mar',
- date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, mar', 'dd, yyyy, HH:mm, MMM'))
+ date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, mar', 'dd, y, HH:mm, MMM'))
);
$this->assertEquals(
'Dec 01, 1971, 23:59',
@@ -63,7 +63,7 @@ public function testMonthTitle()
);
$this->assertEquals(
'05, 1991, 01:09, Mar',
- date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, march', 'dd, yyyy, HH:mm, MMMM'))
+ date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, march', 'dd, y, HH:mm, MMMM'))
);
$this->assertEquals(
'Dec 01, 1971, 23:59',
@@ -86,7 +86,7 @@ public function testLocaleShortMonthTitle()
);
$this->assertEquals(
'05, 1991, 01:09, Mar',
- date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, март', 'dd, yyyy, HH:mm, MMM'))
+ date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, март', 'dd, y, HH:mm, MMM'))
);
$this->assertEquals(
'Dec 01, 1971, 23:59',
@@ -102,7 +102,7 @@ public function testLocaleShortMonthTitle()
);
$this->assertEquals(
'05, 1991, 01:09, Mar',
- date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, mär', 'dd, yyyy, HH:mm, MMM'))
+ date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, mär', 'dd, y, HH:mm, MMM'))
);
$this->assertEquals(
'Dec 01, 1971, 23:59',
@@ -118,7 +118,7 @@ public function testLocaleShortMonthTitle()
);
$this->assertEquals(
'05, 1991, 01:09, Mar',
- date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, 三月', 'dd, yyyy, HH:mm, MMM'))
+ date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, 三月', 'dd, y, HH:mm, MMM'))
);
$this->assertEquals(
'Dec 01, 1971, 23:59',
@@ -145,7 +145,7 @@ public function testLocaleMonthTitle()
);
$this->assertEquals(
'05, 1991, 01:09, Mar',
- date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, март', 'dd, yyyy, HH:mm, MMMM'))
+ date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, март', 'dd, y, HH:mm, MMMM'))
);
$this->assertEquals(
'Dec 01, 1971, 23:59',
@@ -161,7 +161,7 @@ public function testLocaleMonthTitle()
);
$this->assertEquals(
'05, 1991, 01:09, Mar',
- date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, März', 'dd, yyyy, HH:mm, MMMM'))
+ date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, März', 'dd, y, HH:mm, MMMM'))
);
$this->assertEquals(
'Dec 01, 1971, 23:59',
@@ -177,7 +177,7 @@ public function testLocaleMonthTitle()
);
$this->assertEquals(
'05, 1991, 01:09, Mar',
- date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, 三月', 'dd, yyyy, HH:mm, MMMM'))
+ date('d, Y, H:i, M', CDateTimeParser::parse('05, 1991, 01:09, 三月', 'dd, y, HH:mm, MMMM'))
);
$this->assertEquals(
'Dec 01, 1971, 23:59',
@@ -193,7 +193,7 @@ public function testFailing()
{
// empty parsed string
$this->assertFalse(CDateTimeParser::parse('', 'dd MMMM, yyyy, HH:mm'));
- $this->assertFalse(CDateTimeParser::parse(false, 'dd MMMM, yyyy, HH:mm'));
+ $this->assertFalse(CDateTimeParser::parse(false, 'dd MMMM, y, HH:mm'));
$this->assertFalse(CDateTimeParser::parse(null, 'dd MMMM, yyyy, HH:mm'));
// accidently mixed up arguments

0 comments on commit 156a568

Please sign in to comment.