/** * @test */ function shouldTimestampUsingTrait() { $sport = new UsingTrait(); $sport->setTitle('Sport'); $this->em->persist($sport); $this->em->flush(); $this->assertNotNull($sport->getCreatedAt()); $this->assertNotNull($sport->getUpdatedAt()); }
/** * @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())); }