public function testSetValue() { $foo = new HTML_QuickForm2_Container_Group('foo'); $fooBar = $foo->addText('bar'); $fooBaz = $foo->addText('ba[z]'); $fooQuux = $foo->addGroup('qu')->addText('ux'); $fooNop = $foo->addGroup(); $fooXyzzy = $fooNop->addText('xyzzy'); $fooYzzyx = $fooNop->addText('yzzyx'); $foo->setValue(array('bar' => 'first value', 'ba' => array('z' => 'second value'), 'qu' => array('ux' => 'third value'), array('xyzzy' => 'fourth value'), array('yzzyx' => 'fifth value'))); $this->assertEquals('first value', $fooBar->getValue()); $this->assertEquals('second value', $fooBaz->getValue()); $this->assertEquals('third value', $fooQuux->getValue()); $this->assertEquals('fourth value', $fooXyzzy->getValue()); $this->assertEquals('fifth value', $fooYzzyx->getValue()); $anon = new HTML_QuickForm2_Container_Group(); $e1 = $anon->addText('e1'); $e2 = $anon->addText('e2[i1]'); $e3 = $anon->addGroup('g1')->addText('e3'); $g2 = $anon->addGroup(); $e4 = $g2->addText('e4'); $e5 = $g2->addText('e5'); $anon->setValue(array('e1' => 'first value', 'e2' => array('i1' => 'second value'), 'g1' => array('e3' => 'third value'), array('e4' => 'fourth value'), array('e5' => 'fifth value'))); $this->assertEquals('first value', $e1->getValue()); $this->assertEquals('second value', $e2->getValue()); $this->assertEquals('third value', $e3->getValue()); $this->assertEquals('fourth value', $e4->getValue()); $this->assertEquals('fifth value', $e5->getValue()); }