/** * Repopulates the fields using input data. By default uses a combination * of get and post but other data can be used by passing a child of InputElement * * @param \Fuel\Fieldset\Data\SimpleInput $data * * @since 2.0 */ public function repopulate(SimpleInput $data = null) { if (is_null($data)) { $data = new SimpleInput(); } $this->populate($data->input()); return $this; }
/** * @covers ::input * @group Fieldset */ public function testSimpleInputAll() { $_POST['mockdata'] = ['one' => 'first value', 'three' => 'overridden']; $_GET['mockdata'] = ['two' => 'second value', 'three' => 'third value']; $object = new SimpleInput(); $expected = ['mockdata' => ['one' => 'first value', 'two' => 'second value', 'three' => 'overridden']]; $this->assertEquals($expected, $object->input()); }