symfony/symfony — Issue #3157: [Validator] Does not work with groups
Author: getme
Created: 2012-01-19 19:13:43+00:00
State: open

Can't get validation to work, it works with Form though

```php
namespace My\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
*/
class Customer
{
/**
* @Assert\NotBlank(groups={"New"})
* @var string $email
*/
private $email;
}

$customer = new \My\Customer();
$validator = $this->container->get('validator', array('New'));
$errors = $validator->validate($customer);
print_r($errors); // Symfony\Component\Validator\ConstraintViolationList Object ( [violations:protected] => Array ( ) )
```

Also if I change group to "Default" it works, what is wrong?