function let(CategoryManager $categoryManager, CategoryRepositoryInterface $categoryRepository) { $categoryRepository->findBy(['parent' => null])->willReturn(['this', 'is', 'a', 'category', 'tree']); $categoryManager->getEntityRepository()->willReturn($categoryRepository); $this->beConstructedWith($categoryManager, 'Pim\\Bundle\\CatalogBundle\\Entity\\Category', 'Pim\\Bundle\\EnrichBundle\\MassEditAction\\Operation\\Classify'); }
/** * {@inheritDoc} */ public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['trees'] = $this->categoryRepository->findBy(['parent' => null]); }