/**
  * @test
  */
 public function shouldDecrementStackOnPostExecute()
 {
     $request = new \stdClass();
     $action = $this->createActionMock();
     $logger = $this->createLoggerMock();
     $logger->expects($this->at(0))->method('debug')->with($this->stringStartsWith('[Payum] 2# '));
     $logger->expects($this->at(1))->method('debug')->with($this->stringStartsWith('[Payum] 1# '));
     $extension = new LogExecutedActionsExtension($logger);
     $extension->onPreExecute($request);
     $extension->onPreExecute($request);
     $extension->onExecute($request, $action);
     $extension->onPostExecute($request, $action);
     $extension->onExecute($request, $action);
 }
 /**
  * @test
  */
 public function shouldLogExceptionWhenSetButActionNotSetOnPostExecute()
 {
     $logger = $this->createLoggerMock();
     $logger->expects($this->at(0))->method('debug')->with('[Payum] 1# Gateway::execute(string) throws exception LogicException');
     $extension = new LogExecutedActionsExtension($logger);
     $context = new Context($this->createGatewayMock(), 'string', array());
     $context->setException(new \LogicException());
     $extension->onPostExecute($context);
 }