summaryrefslogtreecommitdiff
path: root/www/wiki/tests/phpunit/mocks/MockWebRequest.php
blob: 90475c384ad255d954a5ee2cb669fdc1556f94e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?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;
	}
}