public function testGetCurrentCategoryIfCurrentCategoryIsNotSet() { $rootCategoryId = 333; $this->currentCategory->getData('current_category', null); $this->registry->expects($this->once())->method('registry')->with($this->equalTo('current_category'))->willReturn(null); $this->categoryRepository->expects($this->once())->method('get')->with($rootCategoryId)->willReturn($this->category); $this->store->expects($this->any())->method('getRootCategoryId')->will($this->returnValue($rootCategoryId)); $this->assertEquals($this->currentCategory, $this->model->getCurrentCategory()); $this->assertEquals($this->currentCategory, $this->model->getData('current_category')); }