/** * @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); }
/** * @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()); }
/** * @test */ public function shouldAllowGetUrlSetInConstructor() { $expectedUrl = 'theUrl'; $request = new HttpRedirect($expectedUrl); $this->assertEquals($expectedUrl, $request->getUrl()); }