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


PHP UrlInterface::expects方法代码示例

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


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

示例1: testGetConfig

 /**
  * @covers \Magento\Cms\Model\Wysiwyg\Config::getConfig
  * @param array $data
  * @param boolean $isAuthorizationAllowed
  * @param array $expectedResults
  *
  * @dataProvider getConfigDataProvider
  */
 public function testGetConfig($data, $isAuthorizationAllowed, $expectedResults)
 {
     $wysiwygPluginSettings = ['wysiwygPluginSettings' => 'wysiwyg is here'];
     $pluginSettings = ['pluginSettings' => 'plugins are here'];
     $this->backendUrlMock->expects($this->atLeastOnce())->method('getUrl')->withConsecutive(['cms/wysiwyg/directive'], ['cms/wysiwyg_images/index']);
     $this->assetRepoMock->expects($this->atLeastOnce())->method('getUrl')->withConsecutive(['mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css'], ['mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css']);
     $this->authorizationMock->expects($this->atLeastOnce())->method('isAllowed')->with('Magento_Cms::media_gallery')->willReturn($isAuthorizationAllowed);
     $this->variableConfigMock->expects($this->any())->method('getWysiwygPluginSettings')->willReturn($wysiwygPluginSettings);
     $this->widgetConfigMock->expects($this->any())->method('getPluginSettings')->willReturn($pluginSettings);
     $config = $this->wysiwygConfig->getConfig($data);
     $this->assertInstanceOf('Magento\\Framework\\Object', $config);
     $this->assertEquals($expectedResults[0], $config->getData('someData'));
     $this->assertEquals($expectedResults[1], $config->getData('wysiwygPluginSettings'));
     $this->assertEquals($expectedResults[2], $config->getData('pluginSettings'));
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:23,代码来源:ConfigTest.php

示例2: testGetConfig

 /**
  * @covers \Magento\Cms\Model\Wysiwyg\Config::getConfig
  * @param array $data
  * @param boolean $isAuthorizationAllowed
  * @param array $expectedResults
  *
  * @dataProvider getConfigDataProvider
  */
 public function testGetConfig($data, $isAuthorizationAllowed, $expectedResults)
 {
     $wysiwygPluginSettings = ['wysiwygPluginSettings' => 'wysiwyg is here'];
     $pluginSettings = ['pluginSettings' => 'plugins are here'];
     $this->backendUrlMock->expects($this->atLeastOnce())->method('getUrl')->withConsecutive(['cms/wysiwyg/directive'], ['cms/wysiwyg_images/index']);
     $this->backendUrlMock->expects($this->once())->method('getBaseUrl')->willReturn('localhost/index.php/');
     $this->assetRepoMock->expects($this->atLeastOnce())->method('getUrl')->withConsecutive(['mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css'], ['mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css']);
     $this->filesystemMock->expects($this->once())->method('getUri')->willReturn('pub/static');
     /** @var \Magento\Framework\View\Asset\ContextInterface|\PHPUnit_Framework_MockObject_MockObject $contextMock */
     $contextMock = $this->getMock(\Magento\Framework\View\Asset\ContextInterface::class);
     $contextMock->expects($this->once())->method('getBaseUrl')->willReturn('localhost/pub/static/');
     $this->assetRepoMock->expects($this->once())->method('getStaticViewFileContext')->willReturn($contextMock);
     $this->authorizationMock->expects($this->atLeastOnce())->method('isAllowed')->with('Magento_Cms::media_gallery')->willReturn($isAuthorizationAllowed);
     $this->variableConfigMock->expects($this->any())->method('getWysiwygPluginSettings')->willReturn($wysiwygPluginSettings);
     $this->widgetConfigMock->expects($this->any())->method('getPluginSettings')->willReturn($pluginSettings);
     $config = $this->wysiwygConfig->getConfig($data);
     $this->assertInstanceOf('Magento\\Framework\\DataObject', $config);
     $this->assertEquals($expectedResults[0], $config->getData('someData'));
     $this->assertEquals($expectedResults[1], $config->getData('wysiwygPluginSettings'));
     $this->assertEquals($expectedResults[2], $config->getData('pluginSettings'));
     $this->assertEquals('localhost/pub/static/', $config->getData('baseStaticUrl'));
     $this->assertEquals('localhost/pub/static/', $config->getData('baseStaticDefaultUrl'));
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:31,代码来源:ConfigTest.php

示例3: testSetRefererOrBaseUrl

 public function testSetRefererOrBaseUrl()
 {
     $this->urlBuilder->expects($this->once())->method('getUrl')->willReturn($this->url);
     $this->redirect->expects($this->once())->method('getRedirectUrl')->with($this->url)->willReturn('test string');
     $this->action->setRefererOrBaseUrl();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:6,代码来源:RedirectTest.php


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