public function testToArray() { $blog = new Blog(array('name' => 'foo', 'url' => '*****@*****.**')); $array = $blog->toArray(); $this->assertTrue(is_array($array)); $this->assertEquals('foo', $array['name']); $this->assertEquals('*****@*****.**', $array['url']); $blog->dateCreation = new SimpleAR\DateTime(); SimpleAR\DateTime::setFormat('Y-m-d'); $array = $blog->toArray(); $this->assertEquals(date('Y-m-d'), $array['dateCreation']); SimpleAR\DateTime::setFormat('d/m/Y'); $array = $blog->toArray(); $this->assertEquals(date('d/m/Y'), $array['dateCreation']); }
public function localize($df) { DateTime::setFormat($df); }