/** * @covers ::setName * @group Fieldset */ public function testSetName() { $checkbox1 = new Checkbox(); $checkbox2 = new Checkbox(); $this->object[] = $checkbox1; $this->object[] = $checkbox2; $name = 'test'; $this->object->setName($name); $this->assertEquals($checkbox1->getName(), $name . '[]'); $this->assertEquals($checkbox2->getName(), $name . '[]'); }
/** * @covers ::getName * @covers ::isAutoArray * @group Fieldset */ public function testChildNameSet() { $child = new Checkbox(); $name = 'test[]'; $this->object[] = $child; $this->object->setName($name); $this->assertEquals($name, $child->getName()); }