public function testCreate()
 {
     $objectOne = $this->getMock('Magento\\Catalog\\Model\\ResourceModel\\Category\\Collection', [], [], '', false);
     $objectTwo = $this->getMock('Magento\\Catalog\\Model\\ResourceModel\\Category\\Collection', [], [], '', false);
     $this->_objectManager->expects($this->exactly(2))->method('create')->with('Magento\\Catalog\\Model\\ResourceModel\\Category\\Collection', [])->will($this->onConsecutiveCalls($objectOne, $objectTwo));
     $this->assertSame($objectOne, $this->_model->create());
     $this->assertSame($objectTwo, $this->_model->create());
 }
 /**
  * Enter description here...
  *
  * @param boolean $sorted
  * @return Collection
  */
 protected function _getDefaultCollection($sorted = false)
 {
     $this->_joinUrlRewriteIntoCollection = true;
     $collection = $this->_collectionFactory->create();
     $attributes = $this->_attributeConfig->getAttributeNames('catalog_category');
     $collection->addAttributeToSelect($attributes);
     if ($sorted) {
         if (is_string($sorted)) {
             // $sorted is supposed to be attribute name
             $collection->addAttributeToSort($sorted);
         } else {
             $collection->addAttributeToSort('name');
         }
     }
     return $collection;
 }
 /**
  * @return \Magento\Catalog\Model\ResourceModel\Category\Collection
  */
 public function getCategoryCollection()
 {
     return $this->categoryCollectionFactory->create();
 }