public function validate($category, Constraint $constraint)
 {
     if ($category && $category->getLocale() == $this->locales->getLocaleActive()) {
         if ($this->selectCategoryParentMultilangue($category->getId()) != count($this->locales->getLocales()) - 1) {
             $this->context->buildViolation($constraint->message)->setParameter('%string%', $category->getName())->addViolation();
         }
     }
 }
Esempio n. 2
0
 public function testGetLocalesTranslation()
 {
     $result = $this->locales->getLocales(true);
     $this->assertEquals($this->resultLocalesTranslation(), $result);
 }