Explorar el Código

test for issue #ZF-8332: setting date components need to be done in reverse order (year, month, day)

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19025 44c647ce-9c0f-0410-b52a-842ac1e357ba
dragonbe hace 16 años
padre
commit
5dc67d1871
Se han modificado 1 ficheros con 13 adiciones y 0 borrados
  1. 13 0
      tests/Zend/DateTest.php

+ 13 - 0
tests/Zend/DateTest.php

@@ -4471,6 +4471,19 @@ class Zend_DateTest extends PHPUnit_Framework_TestCase
             $this->assertSame("$weekday.01.1970 00:00:00", $dw->toString());
         }
     }
+    
+    /**
+     * @group   ZF-8332
+     */
+    public function testSetDayOnThirtyFirstGivesThirtyOne()
+    {
+        $locale = new Zend_Locale('en_US');
+        $date = new Zend_Date();
+        $date->setYear(2009, $locale)
+             ->setMonth(5, $locale)
+             ->setDay(31, $locale);
+        $this->assertSame('5/31/09', $date->get(Zend_Date::DATE_SHORT, $locale));
+    }
 
     /**
      * test setWeekday