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: * Stub the send() method so headers and output are not sent.
25: *
26: * @return $this
27: */
28: public function send()
29: {
30: if ($this->hasHeader('Location') && $this->_status === 200) {
31: $this->statusCode(302);
32: }
33: $this->_setContentType();
34:
35: return $this;
36: }
37: }
38: