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


PHP IRequest::method方法代码示例

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


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

示例1: testAddGroupWithSpecialChar

 public function testAddGroupWithSpecialChar()
 {
     $this->request->method('getParam')->with('groupid')->willReturn('Iñtërnâtiônàlizætiøn');
     $this->groupManager->method('groupExists')->with('Iñtërnâtiônàlizætiøn')->willReturn(false);
     $this->groupManager->expects($this->once())->method('createGroup')->with('Iñtërnâtiônàlizætiøn');
     $result = $this->api->addGroup([]);
     $this->assertInstanceOf('OC_OCS_Result', $result);
     $this->assertTrue($result->succeeded());
 }
开发者ID:kenwi,项目名称:core,代码行数:9,代码来源:groupstest.php

示例2: testCreateShareGroup

 public function testCreateShareGroup()
 {
     $share = $this->getMock('\\OC\\Share20\\IShare');
     $this->shareManager->method('newShare')->willReturn($share);
     $ocs = $this->getMockBuilder('OCA\\Files_Sharing\\API\\Share20OCS')->setConstructorArgs([$this->shareManager, $this->groupManager, $this->userManager, $this->request, $this->rootFolder, $this->urlGenerator, $this->currentUser])->setMethods(['formatShare'])->getMock();
     $this->request->method('getParam')->will($this->returnValueMap([['path', null, 'valid-path'], ['permissions', null, \OCP\Constants::PERMISSION_ALL], ['shareType', '-1', \OCP\Share::SHARE_TYPE_GROUP], ['shareWith', null, 'validGroup']]));
     $userFolder = $this->getMock('\\OCP\\Files\\Folder');
     $this->rootFolder->expects($this->once())->method('getUserFolder')->with('currentUser')->willReturn($userFolder);
     $path = $this->getMock('\\OCP\\Files\\Folder');
     $userFolder->expects($this->once())->method('get')->with('valid-path')->willReturn($path);
     $group = $this->getMock('\\OCP\\IGroup');
     $this->groupManager->method('groupExists')->with('validGroup')->willReturn(true);
     $this->groupManager->method('get')->with('validGroup')->willReturn($group);
     $share->method('setPath')->with($path);
     $share->method('setPermissions')->with(\OCP\Constants::PERMISSION_ALL);
     $share->method('setShareType')->with(\OCP\Share::SHARE_TYPE_GROUP);
     $share->method('setSharedWith')->with($group);
     $share->method('setSharedBy')->with($this->currentUser);
     $expected = new \OC_OCS_Result();
     $result = $ocs->createShare();
     $this->assertEquals($expected->getMeta(), $result->getMeta());
     $this->assertEquals($expected->getData(), $result->getData());
 }
开发者ID:gcstang,项目名称:core,代码行数:23,代码来源:share20ocstest.php


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