Ejemplo n.º 1
0
 /**
  * @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));
 }
Ejemplo n.º 2
0
 public function testLoadChange()
 {
     $this->_model->loadChange(1);
     $this->assertNull($this->_model->getId());
 }