Пример #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());
 }
Пример #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()));
 }