diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
commit | 6dc1997577fab2c366781fd7048144935afa0012 (patch) | |
tree | 8918d28c7ab4342f0738985e37af1dfc42d0e93a /tests/phpunit/mocks/MockWebRequest.php | |
parent | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff) | |
parent | fa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff) |
Merge commit 'fa89acd'
# Conflicts:
# .gitignore
# extensions/ArchInterWiki.sql
Diffstat (limited to 'tests/phpunit/mocks/MockWebRequest.php')
-rw-r--r-- | tests/phpunit/mocks/MockWebRequest.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/phpunit/mocks/MockWebRequest.php b/tests/phpunit/mocks/MockWebRequest.php new file mode 100644 index 00000000..3ac5bfb0 --- /dev/null +++ b/tests/phpunit/mocks/MockWebRequest.php @@ -0,0 +1,26 @@ +<?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; + } +} |