Ejemplo n.º 1
0
 public function test_can_set_datetime_attribute_in_constructor()
 {
     $tz = new DateTimeZone('UTC');
     $object = new PodioObject();
     $object->property('datetime_property', 'datetime');
     $object->init(array('datetime_property' => new DateTime('2014-01-01 12:00:00', $tz)));
     $this->assertInstanceOf('DateTime', $object->datetime_property);
     $this->assertEquals('2014-01-01 12:00:00', $object->datetime_property->format('Y-m-d H:i:s'));
 }