public function testAddClaim() { $parameter = new Custom('foo', 'bar'); $this->parameter->addParameter($parameter); $expectedValue = [self::$value[0], 'foo']; $this->assertSame($expectedValue, $this->parameter->getValue()); $this->parameter->addParameter($parameter); $this->assertSame($expectedValue, $this->parameter->getValue(), 'Add parameter duplicates claims'); }
/** * @param HeaderParameter\ParameterInterface $parameter * @param boolean $critical */ public function setParameter(HeaderParameter\ParameterInterface $parameter, $critical = false) { $this->propertyList->setProperty($parameter); if ($critical) { /** @var HeaderParameter\Critical $criticalParameter */ $criticalParameter = $this->findParameterByName(HeaderParameter\Critical::NAME); if (!$criticalParameter) { $criticalParameter = new HeaderParameter\Critical(); } $criticalParameter->addParameter($parameter); $this->propertyList->setProperty($criticalParameter); } }