Example #1
0
 /**
  * @param $cacheReturnValue
  * @param $expectedResult
  *
  * @dataProvider testUnlockActionDataProvider
  */
 public function testUnlockAction($cacheReturnValue, $expectedResult)
 {
     $cacheMock = $this->getMockForAbstractClass(\Magelight\Cache\AdapterAbstract::class, [], '', false, false, true, ['del']);
     $adapterPoolMock = $this->getMock(\Magelight\Cache\AdapterPool::class, [], [], '', false);
     \Magelight\Cache\AdapterPool::forgeMock($adapterPoolMock);
     $adapterPoolMock->expects($this->any())->method('getAdapter')->will($this->returnValue($cacheMock));
     $cacheMock->expects($this->any())->method('del')->with(md5(serialize([]) . '_lock'))->will($this->returnValue($cacheReturnValue));
     $this->controller->init();
     $this->assertEquals($expectedResult, $this->controller->unlockCurrentAction());
 }