title: Symfony2 validation using Assert annotation does not work
body: <p><strong>Update:</strong> since I'm not getting any answers, I've rewritten the entire post using a much simpler example.  Hopefully this helps expose the problem.</p>
  
  <p>I'm having trouble with form validation. I can get the NotBlank() assertion to work, but Type() does not work for me. First, here's the code:</p>
  
  <pre><code>/* ...\Entity\LineItem.php */
  &lt;?php
  
  namespace Rialto\ExperimentBundle\Entity;
  
  use Symfony\Component\Validator\Constraints as Assert;
  
  class LineItem
  {
      /**
       * @var integer
       * @Assert\NotBlank()
       * @Assert\Type(type="integer")
       */
      private $quantity = 0;
  
      public function getQuantity()
      {
          return $this-&gt;quantity;
      }
  
      public function setQuantity($quantity)
      {
          $this-&gt;quantity = $quantity;
      }
  }
  
  /* ...\Controller\DefaultController.php */
  &lt;?php
  
  namespace Rialto\ExperimentBundle\Controller;
  
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\HttpFoundation\Response;
  
  use Rialto\ExperimentBundle\Entity\LineItem;
  
  
  class DefaultController extends Controller
  {
      public function indexAction()
      {
          return $this-&gt;testValidation();
      }
  
      private function testValidation()
      {
          $item = new LineItem();
  
          $form = $this-&gt;createFormBuilder($item)
              -&gt;add('quantity', 'integer')
              -&gt;getForm();
  
          $request = $this-&gt;getRequest();
          if ( $request-&gt;getMethod() == 'POST') {
              $form-&gt;bindRequest($request);
  
              if ( $form-&gt;isValid() ) {
                  return new Response('Form is valid.');
              }
          }
  
          return $this-&gt;render('RialtoCoreBundle:Form:basicForm.html.twig', array(
              'form' =&gt; $form-&gt;createView(),
          ));
      }
  }
  </code></pre>
  
  <p>When I leave the input blank, I get an error message, as expected. But when I type "adsf" into the input, I see the output "Form is valid". I've tried the same thing using YAML and PHP validation. Can anyone see what I've done wrong?</p>
  
  <p>Thanks,
  - Ian</p>