本文整理汇总了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());
}
示例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());
}