Skip to content

Commit

Permalink
Fix a few errors/update a few things from 2.x
Browse files Browse the repository at this point in the history
Fix up classnames and remove no longer needed version checks.
  • Loading branch information
markstory committed Apr 14, 2013
1 parent b8e06d6 commit 9166bb1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Network/Request.php
Expand Up @@ -550,12 +550,12 @@ public function is($type) {
* Check that a request matches all the given types.
*
* Allows you to test multiple types and union the results.
* See CakeRequest::is() for how to add additional types and the
* See Request::is() for how to add additional types and the
* built-in types.
*
* @param array $types The types to check.
* @return boolean Success.
* @see CakeRequest::is()
* @see Request::is()
*/
public function isAll(array $types) {
$result = array_filter(array_map(array($this, 'is'), $types));
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/TestCase/Console/Command/SchemaShellTest.php
Expand Up @@ -539,7 +539,7 @@ public function testUpdateWithTableCreate() {
->will($this->returnValue('y'));
$r = $this->Shell->expects($this->once())
->method('_run')
->with($this->arrayHasKey('newone'), 'update', $this->isInstanceOf('CakeSchema'));
->with($this->arrayHasKey('newone'), 'update', $this->isInstanceOf('Cake\Model\Schema'));

$this->Shell->update();
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Test/TestCase/Network/RequestTest.php
Expand Up @@ -108,7 +108,7 @@ public function testQueryStringAndNamedParams() {

$_SERVER['REQUEST_URI'] = '/tasks/index/?ts=123456';
$request = Request::createFromGlobals();
$this->assertEquals('tasks/index', $request->url);
$this->assertEquals('tasks/index/', $request->url);

$_SERVER['REQUEST_URI'] = '/some/path?url=http://cakephp.org';
$request = Request::createFromGlobals();
Expand Down Expand Up @@ -639,7 +639,7 @@ public function testIsHttpMethods() {
* @return void
*/
public function testIsMultiple() {
$request = new CakeRequest('some/path');
$request = new Request();

$_SERVER['REQUEST_METHOD'] = 'GET';
$this->assertTrue($request->is(array('get', 'post')));
Expand All @@ -657,7 +657,7 @@ public function testIsMultiple() {
* @return void
*/
public function testIsAll() {
$request = new CakeRequest('some/path');
$request = new Request();

$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
$_SERVER['REQUEST_METHOD'] = 'GET';
Expand Down Expand Up @@ -1754,7 +1754,7 @@ public function testQueryWithArray() {
* @return void
*/
public function testReadingParams() {
$request = new CakeRequest();
$request = new Request();
$request->addParams(array(
'controller' => 'posts',
'admin' => true,
Expand Down
8 changes: 3 additions & 5 deletions lib/Cake/Utility/File.php
Expand Up @@ -567,14 +567,12 @@ public function mime() {
/**
* Clear PHP's internal stat cache
*
* For 5.3 onwards its possible to clear cache for just a single file. Passing true
* will clear all the stat cache.
*
* @param boolean $all Clear all cache or not
* @param boolean $all Clear all cache or not. Passing false will clear
* the stat cache for the current path only.
* @return void
*/
public function clearStatCache($all = false) {
if ($all === false && version_compare(PHP_VERSION, '5.3.0') >= 0) {
if ($all === false) {
return clearstatcache(true, $this->path);
}

Expand Down

0 comments on commit 9166bb1

Please sign in to comment.