当前位置: 首页>>代码示例>>PHP>>正文


PHP TypeListInterface::expects方法代码示例

本文整理汇总了PHP中Magento\Framework\App\Cache\TypeListInterface::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP TypeListInterface::expects方法的具体用法?PHP TypeListInterface::expects怎么用?PHP TypeListInterface::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\App\Cache\TypeListInterface的用法示例。


在下文中一共展示了TypeListInterface::expects方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testAfterSave

 /**
  * @param int $callNumber
  * @param string $oldValue
  * @dataProvider afterSaveDataProvider
  */
 public function testAfterSave($callNumber, $oldValue)
 {
     $this->cacheTypeListMock->expects($this->exactly($callNumber))->method('invalidate');
     $this->configMock->expects($this->any())->method('getValue')->willReturnMap([[Theme::XML_PATH_INVALID_CACHES, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null, ['block_html' => 1, 'layout' => 1, 'translate' => 1]], [null, \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, $oldValue]]);
     $this->model->setValue('some_value');
     $this->assertInstanceOf(get_class($this->model), $this->model->afterSave());
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:12,代码来源:ThemeTest.php

示例2: testAfterDelete

 public function testAfterDelete()
 {
     $this->configMock->expects($this->any())->method('getValue')->willReturnMap([[Theme::XML_PATH_INVALID_CACHES, ScopeInterface::SCOPE_STORE, null, ['block_html' => 1, 'layout' => 1, 'translate' => 1]], [null, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, 'old_value']]);
     $this->cacheTypeListMock->expects($this->exactly(2))->method('invalidate');
     $this->model->setValue('some_value');
     $this->assertSame($this->model, $this->model->afterDelete());
 }
开发者ID:rafaelstz,项目名称:magento2,代码行数:7,代码来源:ThemeTest.php

示例3: testExecute

 /**
  * @dataProvider invalidateCacheDataProvider
  * @param bool $cacheState
  */
 public function testExecute($cacheState)
 {
     $this->_configMock->expects($this->once())->method('isEnabled')->will($this->returnValue($cacheState));
     if ($cacheState) {
         $this->_typeListMock->expects($this->once())->method('invalidate')->with($this->equalTo('full_page'));
     }
     $this->_model->execute($this->observerMock);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:12,代码来源:InvalidateCacheTest.php

示例4: testAfterExecuteInvalidate

 public function testAfterExecuteInvalidate()
 {
     $subject = $this->getMockBuilder('Magento\\Catalog\\Model\\Indexer\\Category\\Product\\AbstractAction')->disableOriginalConstructor()->getMockForAbstractClass();
     $result = $this->getMockBuilder('Magento\\Catalog\\Model\\Indexer\\Category\\Product\\AbstractAction')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->config->expects($this->once())->method('isEnabled')->willReturn(true);
     $this->typeList->expects($this->once())->method('invalidate')->with('full_page');
     $this->assertEquals($result, $this->execute->afterExecute($subject, $result));
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:8,代码来源:ExecuteTest.php

示例5: testExecuteNoChanged

 /**
  * @dataProvider invalidateCacheDataProvider
  * @param bool $cacheState
  */
 public function testExecuteNoChanged($cacheState)
 {
     $this->configMock->expects($this->once())->method('isEnabled')->will($this->returnValue($cacheState));
     $this->typeListMock->expects($this->never())->method('invalidate');
     if ($cacheState) {
         $this->objectMock->expects($this->once())->method('getIdentities')->will($this->returnValue([]));
     }
     $this->model->execute($this->observerMock);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:13,代码来源:InvalidateCacheIfChangedTest.php

示例6: testAroundSave

 public function testAroundSave()
 {
     $subject = $this->getMockBuilder('Magento\\Catalog\\Model\\ResourceModel\\Attribute')->disableOriginalConstructor()->getMock();
     $attribute = $this->getMockBuilder('Magento\\Catalog\\Model\\ResourceModel\\Eav\\Attribute')->disableOriginalConstructor()->getMock();
     $self = $this;
     $proceed = function ($object) use($self, $attribute) {
         $self->assertEquals($object, $attribute);
     };
     $this->config->expects($this->once())->method('isEnabled')->willReturn(true);
     $this->typeList->expects($this->once())->method('invalidate')->with('full_page');
     $this->save->aroundSave($subject, $proceed, $attribute);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:SaveTest.php

示例7: testAfterSave

 /**
  * @param int $callNumber
  * @param string $oldValue
  * @dataProvider afterSaveDataProvider
  */
 public function testAfterSave($callNumber, $oldValue)
 {
     $this->cacheTypeListMock->expects($this->exactly($callNumber))->method('invalidate');
     $this->configMock->expects($this->any())->method('getValue')->willReturn($oldValue);
     $this->model->setValue('some_value');
     $this->assertInstanceOf(get_class($this->model), $this->model->afterSave());
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:12,代码来源:ValueTest.php

示例8: testSetCurrencySymbolData

 public function testSetCurrencySymbolData()
 {
     $websiteId = 1;
     $groupId = 2;
     $currencies = 'USD,EUR';
     $symbols = [];
     $value['options']['fields']['customsymbol']['inherit'] = 1;
     $this->prepareMocksForGetCurrencySymbolsData($websiteId, $groupId, $currencies);
     /**
      * @var \Magento\Config\Model\Config|\PHPUnit_Framework_MockObject_MockObject
      */
     $configMock = $this->getMock('Magento\\Config\\Model\\Config', ['setSection', 'setWebsite', 'setStore', 'setGroups', 'save'], [], '', false);
     $this->configFactoryMock->expects($this->any())->method('create')->willReturn($configMock);
     $configMock->expects($this->any())->method('setSection')->with(Currencysymbol::CONFIG_SECTION)->willReturnSelf();
     $configMock->expects($this->any())->method('setWebsite')->with(null)->willReturnSelf();
     $configMock->expects($this->any())->method('setStore')->with(null)->willReturnSelf();
     $configMock->expects($this->any())->method('setGroups')->with($value)->willReturnSelf();
     $this->coreConfigMock->expects($this->once())->method('reinit');
     $this->cacheTypeListMock->expects($this->atLeastOnce())->method('invalidate');
     $this->eventManagerMock->expects($this->atLeastOnce())->method('dispatch')->willReturnMap([['admin_system_config_changed_section_currency_before_reinit', null, null], ['admin_system_config_changed_section_currency', null, null]]);
     $this->assertInstanceOf('Magento\\CurrencySymbol\\Model\\System\\Currencysymbol', $this->model->setCurrencySymbolsData($symbols));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:22,代码来源:CurrencysymbolTest.php

示例9: testGetAvailableTypes

 public function testGetAvailableTypes()
 {
     $types = [['id' => 'foo', 'status' => true], ['id' => 'bar', 'status' => false]];
     $this->cacheTypeList->expects($this->once())->method('getTypes')->willReturn($types);
     $this->assertSame(['foo', 'bar'], $this->model->getAvailableTypes());
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:6,代码来源:ManagerTest.php

示例10: testAfterDelete

 /**
  * @return void;
  */
 public function testAfterDelete()
 {
     $this->cacheTypeListMock->expects($this->once())->method('invalidate');
     $this->assertInstanceOf(get_class($this->model), $this->model->afterDelete());
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:8,代码来源:ValueTest.php


注:本文中的Magento\Framework\App\Cache\TypeListInterface::expects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。