/**
     * @test
     */
    public function shouldLogHttpRedirectReplyWithUrlIncludedOnReply()
    {
        $action = new FooAction();
        $reply = new HttpRedirect('http://example.com');

        $logger = $this->createLoggerMock();
        $logger
            ->expects($this->at(0))
            ->method('debug')
            ->with('[Payum] 1# FooAction::execute(string) throws reply HttpRedirect{url: '.$reply->getUrl().'}')
        ;

        $extension = new LogExecutedActionsExtension($logger);

        $extension->onPreExecute('string');
        $extension->onReply($reply, 'string', $action);
    }
Пример #2
0
 /**
  * @test
  */
 public function shouldAllowGetCustomHeadersSetInConstructor()
 {
     $customHeaders = array('foo' => 'fooVal', 'bar' => 'barVal');
     $expectedHeaders = $customHeaders;
     $expectedHeaders['Location'] = 'anUrl';
     $request = new HttpRedirect('anUrl', 302, $customHeaders);
     $this->assertEquals($expectedHeaders, $request->getHeaders());
 }
Пример #3
0
 /**
  * @test
  */
 public function shouldAllowGetUrlSetInConstructor()
 {
     $expectedUrl = 'theUrl';
     $request = new HttpRedirect($expectedUrl);
     $this->assertEquals($expectedUrl, $request->getUrl());
 }