public function testAroundSaveNoNeed() { $storeMock = $this->getMock('Magento\\Store\\Model\\Store', array('isObjectNew', 'dataHasChangedFor', '__wakeup'), array(), '', false); $storeMock->expects($this->once())->method('dataHasChangedFor')->with('group_id')->will($this->returnValue(false)); $proceed = $this->mockPluginProceed(); $this->assertFalse($this->model->aroundSave($this->subject, $proceed, $storeMock)); }
public function testAroundSaveNotNew() { $this->stateMock->expects($this->never())->method('isFlatEnabled'); $this->groupMock = $this->getMock('Magento\\Store\\Model\\Group', array('dataHasChangedFor', 'isObjectNew', '__wakeup'), array(), '', false); $this->groupMock->expects($this->once())->method('dataHasChangedFor')->with('root_category_id')->will($this->returnValue(true)); $this->groupMock->expects($this->once())->method('isObjectNew')->will($this->returnValue(true)); $this->assertFalse($this->model->aroundSave($this->subjectMock, $this->closureMock, $this->groupMock)); }
public function testAroundSaveWithoutChanges() { $groupMock = $this->getMock('Magento\\Store\\Model\\Group', ['dataHasChangedFor', 'isObjectNew', '__wakeup'], [], '', false); $groupMock->expects($this->exactly(2))->method('dataHasChangedFor')->will($this->returnValueMap([['root_category_id', false], ['website_id', false]])); $groupMock->expects($this->never())->method('isObjectNew'); $proceed = $this->mockPluginProceed(); $this->assertFalse($this->model->aroundSave($this->subject, $proceed, $groupMock)); }
public function testAroundSaveNoNeed() { $this->mockConfigFlatEnabledNeever(); $storeMock = $this->getMock('Magento\\Store\\Model\\Store', array('isObjectNew', 'dataHasChangedFor', '__wakeup'), array(), '', false); $this->assertFalse($this->model->aroundSave($this->subjectMock, $this->closureMock, $storeMock)); }