コード例 #1
0
    /**
     * @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
ファイル: HttpRedirectTest.php プロジェクト: eamador/Payum
 /**
  * @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
ファイル: HttpRedirectTest.php プロジェクト: stan5621/eduwind
 /**
  * @test
  */
 public function shouldAllowGetUrlSetInConstructor()
 {
     $expectedUrl = 'theUrl';
     $request = new HttpRedirect($expectedUrl);
     $this->assertEquals($expectedUrl, $request->getUrl());
 }