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