wiki.techinc.nl/tests/phpunit/mocks/MockWebRequest.php
Sam Smith 16cea35d85 Configure logged in session length independently
* Add the $wgExtendedLoginCookies configuration variable, which defines
  the set of login cookies that can have their lifetime configured
  independently
* Add the $wgExtendedLoginCookieExpiration configuration variable, which
  dictates when the extended lifetime login cookies expire
* Default $wgExtendedLoginCookieExpiration to null so that the current
  behaviour is unaffected

Bug: T68699
Change-Id: I0cc24524e4d7d9d1d21c9fa8a28c7c76b677b96c
2015-06-23 19:31:20 -04:00

26 lines
475 B
PHP

<?php
/**
* A mock WebRequest.
*
* If the code under test accesses the response via the request (see
* WebRequest#response), then you might be able to use this mock to simplify
* your tests.
*/
class MockWebRequest extends WebRequest
{
/**
* @var WebResponse
*/
protected $response;
public function __construct( WebResponse $response ) {
parent::__construct();
$this->response = $response;
}
public function response() {
return $this->response;
}
}