mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
CS fixes
This commit is contained in:
parent
849abab6a4
commit
bf22e84d65
2 changed files with 17 additions and 17 deletions
|
@ -399,13 +399,13 @@ class CakeRequest implements ArrayAccess {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function contentType() {
|
||||
$type = env('CONTENT_TYPE');
|
||||
if ($type) {
|
||||
return $type;
|
||||
}
|
||||
return env('HTTP_CONTENT_TYPE');
|
||||
}
|
||||
public function contentType() {
|
||||
$type = env('CONTENT_TYPE');
|
||||
if ($type) {
|
||||
return $type;
|
||||
}
|
||||
return env('HTTP_CONTENT_TYPE');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the IP the client is using, or says they are using.
|
||||
|
|
|
@ -151,15 +151,15 @@ class CakeRequestTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testContentType() {
|
||||
$_SERVER['HTTP_CONTENT_TYPE'] = 'application/json';
|
||||
$request = new CakeRequest('/', false);
|
||||
$this->assertEquals('application/json', $request->contentType());
|
||||
public function testContentType() {
|
||||
$_SERVER['HTTP_CONTENT_TYPE'] = 'application/json';
|
||||
$request = new CakeRequest('/', false);
|
||||
$this->assertEquals('application/json', $request->contentType());
|
||||
|
||||
$_SERVER['CONTENT_TYPE'] = 'application/xml';
|
||||
$request = new CakeRequest('/', false);
|
||||
$this->assertEquals('application/xml', $request->contentType(), 'prefer non http header.');
|
||||
}
|
||||
$_SERVER['CONTENT_TYPE'] = 'application/xml';
|
||||
$request = new CakeRequest('/', false);
|
||||
$this->assertEquals('application/xml', $request->contentType(), 'prefer non http header.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test construction
|
||||
|
|
Loading…
Add table
Reference in a new issue