Skip to content

Commit

Permalink
Fixing failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Sep 13, 2014
1 parent 07e1b67 commit 79d288b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/Network/Response.php
Expand Up @@ -442,9 +442,8 @@ public function sendHeaders() {
return;
}

$this->_setCookies();

$codeMessage = $this->_statusCodes[$this->_status];
$this->_setCookies();
$this->_sendHeader("{$this->_protocol} {$this->_status} {$codeMessage}");
$this->_setContentType();

Expand Down
3 changes: 1 addition & 2 deletions tests/TestCase/Network/ResponseTest.php
Expand Up @@ -31,7 +31,7 @@ class ResponseTest extends TestCase {
*/
public function setUp() {
parent::setUp();
ob_start();
include_once __DIR__ . DS . 'mocks.php';
}

/**
Expand All @@ -41,7 +41,6 @@ public function setUp() {
*/
public function tearDown() {
parent::tearDown();
ob_end_clean();
}

/**
Expand Down
28 changes: 28 additions & 0 deletions tests/TestCase/Network/mocks.php
@@ -0,0 +1,28 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/

namespace Cake\Network {

/**
* Mocks the headers_sent() function when invoked from the Cake\Network
* namespace so that it always return false
*
* @return boolean
*/
function headers_sent() {
return false;
}

}

0 comments on commit 79d288b

Please sign in to comment.