Setter function for injection properties. If an empty array is passed to this
method, all (possibly) defined properties are removed from the configuration.
public setProperties ( array $properties ) : void | ||
$properties | array | Array of ConfigurationProperty |
return | void |
/** * @test */ public function passingAnEmptyArrayToSetPropertiesRemovesAllExistingproperties() { $someProperties = ['prop1' => new Configuration\ConfigurationProperty('prop1', 'simple string'), 'prop2' => new Configuration\ConfigurationProperty('prop2', 'another string')]; $this->objectConfiguration->setProperties($someProperties); $this->assertEquals($someProperties, $this->objectConfiguration->getProperties(), 'The set properties could not be retrieved again.'); $this->objectConfiguration->setProperties([]); $this->assertEquals([], $this->objectConfiguration->getProperties(), 'The properties have not been cleared.'); }