Beispiel #1
0
 public function setUp()
 {
     parent::setUp();
     $this->tokenStorage = $this->prophesize(TokenStorageInterface::class);
     $this->tokenStorage->getToken()->willReturn(true);
     // stands for a valid token
     $this->authorizationChecker = $this->prophesize(AuthorizationCheckerInterface::class);
     $this->securityChecker = new SecurityChecker($this->tokenStorage->reveal(), $this->authorizationChecker->reveal());
 }
 public function setUp()
 {
     $this->user = $this->prophesize(UserInterface::class);
     $this->token = $this->prophesize(TokenInterface::class);
     $this->token->getUser()->willReturn($this->user);
     $this->accessControlManager = $this->prophesize(AccessControlManagerInterface::class);
     $this->tokenStorage = $this->prophesize(TokenStorageInterface::class);
     $this->tokenStorage->getToken()->willReturn($this->token->reveal());
     $this->securedEntitySubscriber = new SecuredEntitySubscriber($this->accessControlManager->reveal(), $this->tokenStorage->reveal());
     $this->visitor = $this->prophesize(GenericSerializationVisitor::class);
     $this->objectEvent = $this->prophesize(ObjectEvent::class);
     $this->objectEvent->getVisitor()->willReturn($this->visitor);
 }
Beispiel #3
0
 public function setUp()
 {
     parent::setUp();
     $this->mediaRepository = $this->prophesize(MediaRepositoryInterface::class);
     $this->collectionRepository = $this->prophesize(CollectionRepositoryInterface::class);
     $this->userRepository = $this->prophesize(UserRepositoryInterface::class);
     $this->em = $this->prophesize(EntityManager::class);
     $this->storage = $this->prophesize(StorageInterface::class);
     $this->validator = $this->prophesize(FileValidatorInterface::class);
     $this->formatManager = $this->prophesize(FormatManagerInterface::class);
     $this->tagManager = $this->prophesize(TagManagerInterface::class);
     $this->typeManager = $this->prophesize(TypeManagerInterface::class);
     $this->pathCleaner = $this->prophesize(PathCleanupInterface::class);
     $this->tokenStorage = $this->prophesize(TokenStorageInterface::class);
     $this->securityChecker = $this->prophesize(SecurityCheckerInterface::class);
     $this->ffprobe = $this->prophesize(FFProbe::class);
     $this->mediaManager = new MediaManager($this->mediaRepository->reveal(), $this->collectionRepository->reveal(), $this->userRepository->reveal(), $this->em->reveal(), $this->storage->reveal(), $this->validator->reveal(), $this->formatManager->reveal(), $this->tagManager->reveal(), $this->typeManager->reveal(), $this->pathCleaner->reveal(), $this->tokenStorage->reveal(), $this->securityChecker->reveal(), $this->ffprobe->reveal(), ['view' => 64], '/', 0);
 }