/** * @test * @return void * @covers \Magento\Theme\Model\Design::loadChange * @covers \Magento\Theme\Model\Design::__construct * @covers \Magento\Theme\Model\Design::_construct */ public function testLoadChangeFromCache() { $storeId = 1; $localDate = '2\\28\\2000'; $date = '28-02-2000'; $cacheId = 'design_change_' . md5($storeId . $date); $this->localeDate->expects($this->once())->method('scopeTimeStamp')->with($storeId)->willReturn($localDate); $this->dateTime->expects($this->once())->method('formatDate')->with($localDate, false)->willReturn($date); $this->cacheManager->expects($this->once())->method('load')->with($cacheId)->willReturn(serialize(['test' => 'data'])); $this->assertInstanceOf(get_class($this->model), $this->model->loadChange($storeId)); }
public function testLoadChange() { $this->_model->loadChange(1); $this->assertNull($this->_model->getId()); }