/** * (non-PHPdoc) * @see lib/form/data/collection/phSimpleDataCollection::register() */ public function register(phFormViewElement $element, phNameInfo $name, phCompositeDataCollection $collection) { parent::register($element, $name, $collection); if ($element instanceof phRadioButtonElement) { $this->_radioValues[$name->getFullName()][] = $element->getRawValue(); } }
public function testValidateArrayOk() { $collection = new phSimpleDataCollection(); $composite = new phSimpleTestCompositeDataCollection(); $composite->_collections[] = $collection; $element = new phSimpleTestElement(); $nameInfo = new phNameInfo('test[]'); $collection->register($element, $nameInfo, $composite); /* * check name set properly */ $this->assertEquals('test', $collection->find('test')->getName(), 'name of array data type set properly'); $collection2 = new phSimpleDataCollection(); $collection2->validate($element, $nameInfo, $composite); $this->assertTrue(true, 'validate passed an array, recognising it is different'); }