public function enrich(Metadata $metadata)
 {
     $user = $this->environment->getUser();
     $identifier = $user->getAttribute('identifier');
     $identifier = $identifier ?: $user->getAttribute('login');
     $metadata->setItem('user', $identifier);
     $metadata->setItem('role', $user->getRoleId());
     return $metadata;
 }
Exemplo n.º 2
0
 /**
  * @expectedException Trellis\Common\Error\RuntimeException
  */
 public function testSetItemWithKeyCollision()
 {
     $data = ['test' => 'value'];
     $metadata = new Metadata($data);
     $metadata->setItem('test', 'immutable');
 }