generateUuid() public method

After returning advice, making sure we have an UUID for each and every entity.
public generateUuid ( Neos\Flow\Aop\JoinPointInterface $joinPoint ) : void
$joinPoint Neos\Flow\Aop\JoinPointInterface The current join point
return void
コード例 #1
0
 /**
  * @test
  * @return void
  */
 public function generateUuidGeneratesUuidAndRegistersProxyAsNewObject()
 {
     $className = 'Class' . md5(uniqid(mt_rand(), true));
     eval('class ' . $className . ' implements \\Neos\\Flow\\Persistence\\Aspect\\PersistenceMagicInterface { public $Persistence_Object_Identifier = NULL; }');
     $object = new $className();
     $this->mockJoinPoint->expects($this->atLeastOnce())->method('getProxy')->will($this->returnValue($object));
     $this->mockPersistenceManager->expects($this->atLeastOnce())->method('registerNewObject')->with($object);
     $this->persistenceMagicAspect->generateUuid($this->mockJoinPoint);
     $this->assertEquals(36, strlen($object->Persistence_Object_Identifier));
 }