Symfony\Component\Form\Form::getNormData PHP Method

getNormData() public method

Returns the normalized data of the field.
public getNormData ( ) : mixed
return mixed When the field is not bound, the default data is returned. When the field is bound, the normalized bound data is returned if the field is valid, null otherwise.
    public function getNormData()
    {
        return $this->normData;
    }

Usage Example

 public function testRequestWithValidJsonShouldPopulateForm()
 {
     $request = $this->getRequest('{ "name": "test1" }');
     $this->form->handleRequest($request);
     $this->assertEquals(['name' => 'test1', 'lastname' => null], $this->form->getData());
     $this->assertEquals(['name' => 'test1', 'lastname' => null], $this->form->getNormData());
     $this->assertEquals(['name' => 'test1', 'lastname' => null], $this->form->getViewData());
 }
All Usage Examples Of Symfony\Component\Form\Form::getNormData