Exemplo n.º 1
0
 /**
  * Tests Site->setCreatedValue().
  */
 public function testSetCreatedValue()
 {
     $this->assertNull($this->site->getCreated());
     $this->site->setCreatedValue();
     $this->assertNotNull($this->site->getCreated());
     $this->assertTrue($this->site->getCreated() instanceof \DateTime);
     $date = new \DateTime();
     $date->sub(new \DateInterval('P5Y'));
     $this->site->setCreated($date);
     $this->assertEquals($date, $this->site->getCreated());
     $this->site->setCreatedValue();
     $this->assertEquals($date, $this->site->getCreated());
 }