public function testInterface()
 {
     $post = new Post();
     $yesterday = new \DateTime('yesterday');
     $now = new \DateTime();
     $post->setCreatedAt($yesterday);
     $post->setUpdatedAt($now);
     $this->assertEquals($yesterday, $post->getCreatedAt());
     $this->assertEquals($now, $post->getUpdatedAt());
 }
 public function testPreUpdate()
 {
     $subscriber = new TimestampableSubscriber();
     $post = new Post();
     /** @var ObjectManager $manager */
     $manager = $this->getMock('Doctrine\\Common\\Persistence\\ObjectManager');
     $event = new LifecycleEventArgs($post, $manager);
     $subscriber->preUpdate($event);
     $now = new \DateTime();
     $this->assertNull($post->getCreatedAt());
     $this->assertEquals($post->getUpdatedAt()->format('c'), $now->format('c'));
 }