本文整理汇总了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);
}
示例2: testRevokeShouldCallMaskBuilderRemove
public function testRevokeShouldCallMaskBuilderRemove()
{
$this->maskBuilder->remove(Argument::exact('view'))->shouldBeCalled(1);
$this->permission->revoke('view');
}