Explorar el Código

[ZF-11610] Added string cast to ctype_digit call in Zend_Feed_Writer_Entry

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24644 44c647ce-9c0f-0410-b52a-842ac1e357ba
adamlundrigan hace 14 años
padre
commit
d925e7231d
Se han modificado 1 ficheros con 23 adiciones y 1 borrados
  1. 23 1
      tests/Zend/Feed/Writer/EntryTest.php

+ 23 - 1
tests/Zend/Feed/Writer/EntryTest.php

@@ -268,7 +268,18 @@ class Zend_Feed_Writer_EntryTest extends PHPUnit_Framework_TestCase
         $myDate = new Zend_Date('123456789', Zend_Date::TIMESTAMP);
         $this->assertTrue($myDate->equals($entry->getDateCreated()));
     }
-    
+
+    /**
+     * @group ZF-11610
+     */
+    public function testSetDateCreatedUsesGivenUnixTimestampWhenItIsAVerySmallInteger()
+    {
+        $entry = new Zend_Feed_Writer_Entry;
+        $entry->setDateCreated(123);
+        $myDate = new Zend_Date('123', Zend_Date::TIMESTAMP);
+        $this->assertTrue($myDate->equals($entry->getDateCreated()));
+    }
+
     public function testSetDateCreatedUsesZendDateObject()
     {
         $entry = new Zend_Feed_Writer_Entry;
@@ -304,6 +315,17 @@ class Zend_Feed_Writer_EntryTest extends PHPUnit_Framework_TestCase
         $this->assertTrue($myDate->equals($entry->getDateModified()));
     }
 
+    /**
+     * @group ZF-11610
+     */
+    public function testSetDateModifiedUsesGivenUnixTimestampWhenItIsAVerySmallInteger()
+    {
+        $entry = new Zend_Feed_Writer_Entry;
+        $entry->setDateModified(123);
+        $myDate = new Zend_Date('123', Zend_Date::TIMESTAMP);
+        $this->assertTrue($myDate->equals($entry->getDateModified()));
+    }
+
     public function testSetDateModifiedUsesZendDateObject()
     {
         $entry = new Zend_Feed_Writer_Entry;