Skip to content

Commit

Permalink
Fixed order of assert params
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrang committed Aug 6, 2013
1 parent a6e3bb3 commit 34d848d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/Cake/Test/Case/Network/CakeResponseTest.php
Expand Up @@ -137,45 +137,45 @@ public function testType() {
public function testHeader() {
$response = new CakeResponse();
$headers = array();
$this->assertEquals($response->header(), $headers);
$this->assertEquals($headers, $response->header());

$response->header('Location', 'http://example.com');
$headers += array('Location' => 'http://example.com');
$this->assertEquals($response->header(), $headers);
$this->assertEquals($headers, $response->header());

//Headers with the same name are overwritten
$response->header('Location', 'http://example2.com');
$headers = array('Location' => 'http://example2.com');
$this->assertEquals($response->header(), $headers);
$this->assertEquals($headers, $response->header());

$response->header(array('WWW-Authenticate' => 'Negotiate'));
$headers += array('WWW-Authenticate' => 'Negotiate');
$this->assertEquals($response->header(), $headers);
$this->assertEquals($headers, $response->header());

$response->header(array('WWW-Authenticate' => 'Not-Negotiate'));
$headers['WWW-Authenticate'] = 'Not-Negotiate';
$this->assertEquals($response->header(), $headers);
$this->assertEquals($headers, $response->header());

$response->header(array('Age' => 12, 'Allow' => 'GET, HEAD'));
$headers += array('Age' => 12, 'Allow' => 'GET, HEAD');
$this->assertEquals($response->header(), $headers);
$this->assertEquals($headers, $response->header());

// String headers are allowed
$response->header('Content-Language: da');
$headers += array('Content-Language' => 'da');
$this->assertEquals($response->header(), $headers);
$this->assertEquals($headers, $response->header());

$response->header('Content-Language: da');
$headers += array('Content-Language' => 'da');
$this->assertEquals($response->header(), $headers);
$this->assertEquals($headers, $response->header());

$response->header(array('Content-Encoding: gzip', 'Vary: *', 'Pragma' => 'no-cache'));
$headers += array('Content-Encoding' => 'gzip', 'Vary' => '*', 'Pragma' => 'no-cache');
$this->assertEquals($response->header(), $headers);
$this->assertEquals($headers, $response->header());

$response->header('Access-Control-Allow-Origin', array('domain1', 'domain2'));
$headers += array('Access-Control-Allow-Origin' => array('domain1', 'domain2'));
$this->assertEquals($response->header(), $headers);
$this->assertEquals($headers, $response->header());
}

/**
Expand Down

0 comments on commit 34d848d

Please sign in to comment.