Exemplo n.º 1
0
 /**
  * @test
  */
 function shouldTimestampUsingTrait()
 {
     $sport = new UsingTrait();
     $sport->setTitle('Sport');
     $this->em->persist($sport);
     $this->em->flush();
     $this->assertNotNull($sport->getCreatedAt());
     $this->assertNotNull($sport->getUpdatedAt());
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function traitMethodthShouldReturnObject()
 {
     $sport = new UsingTrait();
     $this->assertInstanceOf('Timestampable\\Fixture\\UsingTrait', $sport->setCreatedAt(new \DateTime()));
     $this->assertInstanceOf('Timestampable\\Fixture\\UsingTrait', $sport->setUpdatedAt(new \DateTime()));
 }