public function testValidData()
 {
     $group = $this->getMock('Oro\\Bundle\\UserBundle\\Entity\\Group');
     $user = $this->getMock('Oro\\Bundle\\UserBundle\\Entity\\User');
     $context = $this->getMockBuilder('Symfony\\Component\\Validator\\ExecutionContext')->disableOriginalConstructor()->getMock();
     $context->expects($this->never())->method('getPropertyPath');
     $context->expects($this->never())->method('addViolationAt');
     //only users
     $this->entity->addUser($user);
     $this->entity->isValid($context);
     // clear users
     $this->entity->getUsers()->clear();
     //only groups
     $this->entity->addGroup($group);
     $this->entity->isValid($context);
     // clear groups
     $this->entity->getGroups()->clear();
     // only email
     $this->entity->setEmail('test Email');
     $this->entity->isValid($context);
     $this->entity->setEmail(null);
     // only owner
     $this->entity->setOwner(true);
     $this->entity->isValid($context);
     $this->entity->setEmail(null);
 }