示例#1
0
 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));
 }
示例#2
0
 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));
 }
示例#3
0
 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));
 }
示例#4
0
 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));
 }
示例#5
0
文件: index.php 项目: naisly/WodenS
<?php

/**
 * Created by PhpStorm.
 * User: Home
 * Date: 27.11.2015
 * Time: 18:53
 */
include_once $_SERVER['DOCUMENT_ROOT'] . '/Model/DefaultModel.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Controllers/DefaultController.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/View/StoreView.php';
$model = new DefaultModel();
//It is important that the controller and the view share the model
$controller = new DefaultController($model);
$view = new StoreView($model);
$controller->actionGetHeaderCart();
$view->getStorePage();