/** * {@inheritDoc} */ public function getLeft() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getLeft', array()); return parent::getLeft(); }
function it_normalizes_an_updated_category_who_have_moved_without_generating_url_key(Category $category, Category $parentCategory, Category $prevCategory, $categoryMapping, $categoryMappingManager, $categoryRepository) { $this->globalContext = array_merge($this->globalContext, ['magentoCategories' => [4 => ['parent_id' => 3]], 'magentoStoreView' => 'default']); $this->globalContext['urlKey'] = true; $category->getParent()->willReturn($parentCategory); $category->getLabel()->willReturn('category_label'); $category->setLocale('default_locale')->shouldBeCalled(); $category->getTranslations()->willReturn([]); $category->getCode()->willReturn('category_code'); $category->getLeft()->willReturn(7); $categoryMappingManager->getIdFromCategory($category, 'soap_url')->willReturn(4); $categoryMappingManager->getIdFromCategory($parentCategory, 'soap_url', $categoryMapping)->willReturn(9); $categoryMappingManager->getIdFromCategory($parentCategory, 'soap_url')->willReturn(3); $categoryRepository->getPrevSiblings($category)->willReturn([$prevCategory]); $categoryMappingManager->getIdFromCategory($prevCategory, 'soap_url', $categoryMapping)->willReturn(5); $categoryMapping->getTarget('category_code')->willReturn('category_code'); $this->normalize($category, 'MagentoArray', $this->globalContext)->shouldReturn(['create' => [], 'update' => [[4, ['name' => 'category_label', 'available_sort_by' => 1, 'default_sort_by' => 1, 'is_anchor' => 1, 'position' => 7], 'default']], 'move' => [[4, 9, 5]], 'variation' => []]); }