public function testInvoke() { $obj = new TestObject(); $metadata = new MethodMetadata('Metadata\\Tests\\Fixtures\\TestObject', 'setFoo'); $this->assertNull($obj->getFoo()); $metadata->invoke($obj, array('foo')); $this->assertEquals('foo', $obj->getFoo()); }
public function unserialize($str) { list($parentStr, $this->roles, $this->paramPermissions, $this->returnPermissions, $this->runAsRoles, $this->satisfiesParentSecurityPolicy) = unserialize($str); parent::unserialize($parentStr); }
/** * {@inheritdoc} */ public function unserialize($str) { list($this->isMethod, $this->isFormHandler, $this->hasNamedParams, $this->isStrict, $this->hasSession, $parameterNames, $this->parameterMetadata, $this->result, $this->authorizationExpression, $parentStr) = unserialize($str); parent::unserialize($parentStr); foreach ($parameterNames as $parameterName) { $this->parameters[$parameterName] = new \ReflectionParameter(array($this->reflection->getDeclaringClass()->name, $this->reflection->name), $parameterName); } }