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


PHP ActionRequest::setDispatched方法代码示例

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


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

示例1: setDispatchedEmitsSignalIfDispatched

 /**
  * @test
  */
 public function setDispatchedEmitsSignalIfDispatched()
 {
     $mockDispatcher = $this->getMock(\TYPO3\Flow\SignalSlot\Dispatcher::class);
     $mockDispatcher->expects($this->once())->method('dispatch')->with(\TYPO3\Flow\Mvc\ActionRequest::class, 'requestDispatched', array($this->actionRequest));
     $mockObjectManager = $this->getMock(\TYPO3\Flow\Object\ObjectManagerInterface::class);
     $mockObjectManager->expects($this->any())->method('get')->will($this->returnValue($mockDispatcher));
     $this->inject($this->actionRequest, 'objectManager', $mockObjectManager);
     $this->actionRequest->setDispatched(true);
 }
开发者ID:kszyma,项目名称:flow-development-collection,代码行数:12,代码来源:ActionRequestTest.php

示例2: setDispatchedEmitsSignalIfDispatched

 /**
  * @test
  */
 public function setDispatchedEmitsSignalIfDispatched()
 {
     $mockDispatcher = $this->getMock('TYPO3\\Flow\\SignalSlot\\Dispatcher');
     $mockDispatcher->expects($this->once())->method('dispatch')->with('TYPO3\\Flow\\Mvc\\ActionRequest', 'requestDispatched', array($this->actionRequest));
     $mockObjectManager = $this->getMock('TYPO3\\Flow\\Object\\ObjectManagerInterface');
     $mockObjectManager->expects($this->any())->method('get')->will($this->returnValue($mockDispatcher));
     $this->inject($this->actionRequest, 'objectManager', $mockObjectManager);
     $this->actionRequest->setDispatched(TRUE);
 }
开发者ID:sokunthearith,项目名称:Intern-Project-Week-2,代码行数:12,代码来源:ActionRequestTest.php

示例3: initializeController

 /**
  * Initializes the controller
  *
  * This method should be called by the concrete processRequest() method.
  *
  * @param \TYPO3\Flow\Mvc\RequestInterface $request
  * @param \TYPO3\Flow\Mvc\ResponseInterface $response
  * @throws \TYPO3\Flow\Mvc\Exception\UnsupportedRequestTypeException
  */
 protected function initializeController(\TYPO3\Flow\Mvc\RequestInterface $request, \TYPO3\Flow\Mvc\ResponseInterface $response)
 {
     if (!$request instanceof ActionRequest) {
         throw new \TYPO3\Flow\Mvc\Exception\UnsupportedRequestTypeException(get_class($this) . ' only supports action requests – requests of type "' . get_class($request) . '" given.', 1187701131);
     }
     $this->request = $request;
     $this->request->setDispatched(true);
     $this->response = $response;
     $this->uriBuilder = new UriBuilder();
     $this->uriBuilder->setRequest($this->request);
     $this->arguments = new Arguments(array());
     $this->controllerContext = new ControllerContext($this->request, $this->response, $this->arguments, $this->uriBuilder);
     $mediaType = $request->getHttpRequest()->getNegotiatedMediaType($this->supportedMediaTypes);
     if ($mediaType === null) {
         $this->throwStatus(406);
     }
     if ($request->getFormat() === null) {
         $this->request->setFormat(MediaTypes::getFilenameExtensionFromMediaType($mediaType));
     }
 }
开发者ID:robertlemke,项目名称:flow-development-collection,代码行数:29,代码来源:AbstractController.php

示例4: initializeControllerContext

 /**
  * The Resource Information most likely needs an UriBuilder, so having a
  * ControllerContext in place might come in handy.
  *
  * @return void
  */
 protected function initializeControllerContext()
 {
     $request = new ActionRequest(Request::createFromEnvironment());
     $request->setDispatched(true);
     $response = new Response();
     $uriBuilder = new UriBuilder();
     $uriBuilder->setRequest($request);
     $arguments = new Arguments(array());
     $this->controllerContext = new ControllerContext($request, $response, $arguments, $uriBuilder);
 }
开发者ID:netlogix,项目名称:jsonapiorg,代码行数:16,代码来源:ResourceMapper.php

示例5: cloneResetsTheStatusToNotDispatched

 /**
  * @test
  */
 public function cloneResetsTheStatusToNotDispatched()
 {
     $httpRequest = HttpRequest::create(new Uri('http://foo.com'));
     $originalRequest = new ActionRequest($httpRequest);
     $originalRequest->setDispatched(TRUE);
     $cloneRequest = clone $originalRequest;
     $this->assertTrue($originalRequest->isDispatched());
     $this->assertFalse($cloneRequest->isDispatched());
 }
开发者ID:animaltool,项目名称:webinterface,代码行数:12,代码来源:ActionRequestTest.php


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