Ejemplo n.º 1
0
 private function searchForMatchingExpectation(ServerRequestInterface $request)
 {
     $lastFound = null;
     foreach ($this->storage->listExpectations() as $expectation) {
         $lastFound = $this->getNextMatchingExpectation($lastFound, $request, $expectation);
     }
     return $lastFound;
 }
Ejemplo n.º 2
0
 /**
  *
  * {@inheritDoc}
  *
  * @see \Mcustiel\PowerRoute\Actions\ActionInterface::execute()
  */
 public function execute(TransactionData $transactionData, $argument = null)
 {
     $list = json_encode($this->storage->listExpectations());
     $transactionData->setResponse($transactionData->getResponse()->withBody(new StringStream($list))->withHeader('Content-type', 'application/json'));
 }