1: <?php
2: /**
3: * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
4: * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
5: *
6: * Licensed under The MIT License
7: * For full copyright and license information, please see the LICENSE.txt
8: * Redistributions of files must retain the above copyright notice
9: *
10: * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
11: * @since 3.0.0
12: * @license https://opensource.org/licenses/mit-license.php MIT License
13: */
14: namespace Cake\TestSuite\Stub;
15:
16: use Cake\Http\Response as Base;
17:
18: /**
19: * A response class intended for test cases.
20: */
21: class Response extends Base
22: {
23:
24: /**
25: * Stub the send() method so headers and output are not sent.
26: *
27: * @return $this
28: */
29: public function send()
30: {
31: if ($this->hasHeader('Location') && $this->_status === 200) {
32: $this->statusCode(302);
33: }
34: $this->_setContentType();
35:
36: return $this;
37: }
38: }
39: