コード例 #1
0
 public function testHandleLoggable()
 {
     $loggableCollectionClass = new LoggableCollectionClass();
     $loggableCollectionClass->setName('testCollectionName');
     $collection = new PersistentCollection($this->em, get_class($loggableCollectionClass), array($loggableCollectionClass));
     $collection->setDirty(true);
     $this->loggableClass->setCollection($collection);
     $this->em->persist($this->loggableClass);
     //log with out user
     $this->loggableManager->handleLoggable($this->em);
     //log with user
     $this->loggableManager->setUsername('testUser');
     $this->loggableManager->handleLoggable($this->em);
     //log delete
     $this->em->remove($this->loggableClass);
     $this->loggableManager->handleLoggable($this->em);
 }
コード例 #2
0
 /**
  * @test
  */
 public function testHandlePostPersist()
 {
     $loggableClass = new LoggableClass();
     $loggableClass->setName('testName');
     $this->loggableManager->handlePostPersist($loggableClass, $this->em);
 }