/**
  * @param UrlRewrite $url
  * @return Category|null|bool
  */
 protected function retrieveCategoryFromMetadata($url)
 {
     $metadata = $url->getMetadata();
     if (isset($metadata['category_id'])) {
         $category = $this->import->getCategoryProcessor()->getCategoryById($metadata['category_id']);
         return $category === null ? false : $category;
     }
     return null;
 }
Example #2
0
 /**
  * Cover getCategoryProcessor().
  */
 public function testGetCategoryProcessor()
 {
     $expectedResult = 'value';
     $this->setPropertyValue($this->importProduct, 'categoryProcessor', $expectedResult);
     $actualResult = $this->importProduct->getCategoryProcessor();
     $this->assertEquals($expectedResult, $actualResult);
 }