function it_updates_a_category($categoryRepository, CategoryInterface $category, CategoryInterface $categoryMaster, CategoryTranslation $translatable) { $categoryRepository->findOneByIdentifier('master')->willReturn($categoryMaster); $category->getTranslation()->willReturn($translatable); $translatable->setLabel('Ma superbe catégorie')->shouldBeCalled(); $category->setCode('mycode')->shouldBeCalled(); $category->setParent($categoryMaster)->shouldBeCalled(); $category->setLocale('fr_FR')->shouldBeCalled(); $category->getId()->willReturn(null); $values = ['code' => 'mycode', 'parent' => 'master', 'labels' => ['fr_FR' => 'Ma superbe catégorie']]; $this->update($category, $values, []); }