title: Custom fields validation of FOS User bundle not being validated
body: <p>I'm usign FOS User bundle and I've added some custom fields (name, surname, address...) and those fields I marked them as required in the validation.yml config (below).</p>
  
  <p>The thing is, in the registration form, when I leave those fields empty and I try to submit the form I can't because they have the required html tag plus the minlen, maxlen properties (below)</p>
  
  <p>So the bundle seems to be using the config file correctly.</p>
  
  <p>But here's the problem I found. I'm using behat to test the application, and I created a test to verify if the account creation works. In one of the scenarios I leave intentionally name, surname blank, so I should see and error message. And the problem is the form is sent because mink doesn't care about html validation and the empty value in name and surname are not validated. And everything ends in an database exception trying to insert a blank value for an empty value in a required field:</p>
  
  <pre><code>An exception occurred while executing &amp;#039;INSERT INTO user (username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expired, expires_at, confirmation_token, password_requested_at, roles, credentials_expired, credentials_expire_at, name, surname, company, address) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)&amp;#039; with params [&amp;quot;test@dirital.com&amp;quot;, &amp;quot;test@dirital.com&amp;quot;, &amp;quot;test@dirital.com&amp;quot;, &amp;quot;test@dirital.com&amp;quot;, 0, &amp;quot;3njo6hthk8ao040okco08wggk4sk4wk&amp;quot;, &amp;quot;namJcPop4lXUwAK4OQXIzRsfKYurv9K+XdvVMTZ4CSEvMf+bLTl4oYTFSKExMI1ROj557mjR89ltnj6L0ETBXA==&amp;quot;, null, 0, 0, null, &amp;quot;o7V72h5PK12VlAZBAVH8QSK6PPsOYL9--iVEUTKE8XQ&amp;quot;, null, &amp;quot;a:0:{}&amp;quot;, 0, null, null, null, null, null]:
    │
    │ SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: user.name&amp;nbsp;
  </code></pre>
  
  <p>I have another test where I test that if I leave blank email and password I should get an error message and those work correctly.</p>
  
  <p>So it appears to be a problem with my configuration in the validation or something similar but I can not put my finger on it.</p>
  
  <p>The validation.yml</p>
  
  <pre><code>UserBundle\Entity\User:
  properties:
      name:
          - NotBlank:
              message: fos_user.field.blank
              groups: [ "UserRegistration", "UserProfile" ]
          - Length:
              min: 2
              minMessage: fos_user.field.short
              max: 100
              maxMessage: fos_user.field.long
              groups: [ "UserRegistration", "ResetPassword" ]
      surname:
          - NotBlank:
              message: fos_user.field.blank
              groups: [ "UserRegistration", "DiritalUserProfile" ]
          - Length:
              min: 2
              minMessage: fos_user.field.short
              max: 100
              maxMessage: fos_user.field.long
              groups: [ "UserRegistration", "ResetPassword" ]
  </code></pre>
  
  <p>The HTML validation code generated in the form
      
          Name
          </p>
  
  <pre><code>&lt;/div&gt;
  
  &lt;div class="form-group"&gt;
      &lt;label class="control-label required" for="fos_user_registration_form_surname"&gt;Surname&lt;/label&gt;
      &lt;input type="text" id="fos_user_registration_form_surname" name="fos_user_registration_form[surname]" required="required" maxlength="100" pattern=".{2,}" class="form-control" /&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>The behat test:</p>
  
  <pre><code>Scenario: When the user doesn't fill all the fields of the form error messages should appear
  Given I am on "/create-account/"
  When I press "Send"
  # This works
  Then I should see "The email is required to create your account"
  When I fill in "Email" with "test@domain.com"
  And I press "Send"
  # This works as well, only the password error shown, the email field has been filled
  Then I should not see "Please fill in the email"
  And I should see "Please fill in the password"
  When I fill in "Password" with "12345"
  And I press "Send"
  # This also works, different passwords should not be sent
  Then I should see "The entered passwords don't match"
  When I fill in "Password" with "12345"
  And I fill in "Repeat password" with "12345"
  And I press "Send"
  # And there is where I get the exception instead the error message for not filling the name, surname fields
  And print last response without tags
  </code></pre>