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


PHP ObjectProphecy::remove方法代码示例

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


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

示例1: testDelete

 public function testDelete()
 {
     $collection = $this->prophesize(Collection::class);
     $collection->getId()->willReturn(2);
     $file = $this->prophesize(File::class);
     $fileVersion = $this->prophesize(FileVersion::class);
     $file->getFileVersions()->willReturn([$fileVersion->reveal()]);
     $fileVersion->getId()->willReturn(1);
     $fileVersion->getName()->willReturn('test');
     $fileVersion->getStorageOptions()->willReturn(json_encode(['segment' => '01', 'fileName' => 'test.jpg']));
     $media = $this->prophesize(Media::class);
     $media->getCollection()->willReturn($collection);
     $media->getFiles()->willReturn([$file->reveal()]);
     $media->getId()->willReturn(1);
     $this->formatManager->purge(1, 'test', json_encode(['segment' => '01', 'fileName' => 'test.jpg']))->shouldBeCalled();
     $this->mediaRepository->findMediaById(1)->willReturn($media);
     $this->securityChecker->checkPermission(new SecurityCondition('sulu.media.collections', null, Collection::class, 2), 'delete')->shouldBeCalled();
     $this->storage->remove(json_encode(['segment' => '01', 'fileName' => 'test.jpg']))->shouldBeCalled();
     $this->mediaManager->delete(1, true);
 }
开发者ID:webs86,项目名称:sulu,代码行数:20,代码来源:MediaManagerTest.php

示例2: testRevokeShouldCallMaskBuilderRemove

 public function testRevokeShouldCallMaskBuilderRemove()
 {
     $this->maskBuilder->remove(Argument::exact('view'))->shouldBeCalled(1);
     $this->permission->revoke('view');
 }
开发者ID:alexdpy,项目名称:acl,代码行数:5,代码来源:PermissionTest.php


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