/** * @depends testGroupWithProperty */ public function testWithMultipleGroups() { $xml = ' <config> <group title="Test Group 1"> <property name="testProperty1">Enter value 1</property> </group> <group title="Test Group 2"> <property name="testProperty2">Enter value 2</property> <property name="testProperty3">Enter value 3</property> </group> </config> '; $propertyGroups = $this->config->readFromXml($xml)->getPropertyGroups(); $this->assertCount(2, $propertyGroups, 'Expected to have 2 groups.'); /** @var Property[] $properties1 */ $properties1 = $propertyGroups[0]->getProperties(); $this->assertCount(1, $properties1, 'Expected count of properties is wrong.'); $this->assertEquals('testProperty1', $properties1[0]->getName()); /** @var Property[] $properties1 */ $properties2 = $propertyGroups[1]->getProperties(); $this->assertCount(2, $properties2, 'Expected count of properties is wrong.'); $this->assertEquals('testProperty2', $properties2[0]->getName()); $this->assertEquals('testProperty3', $properties2[1]->getName()); }
/** * Retrieves the properties from the generator by * reflection * * @return ConfiguratorProperty[] */ protected function retrievePropertiesFromGenerator() { $xmlConfig = call_user_func(array($this->generatorClassName, 'getConfig')); return $this->generatorConfig->readFromXml($xmlConfig)->getPropertyGroups(); }