mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Merge remote branch 'origin/1.2' into 1.2-merger
Conflicts: cake/libs/view/helpers/html.php cake/tests/cases/libs/folder.test.php
This commit is contained in:
commit
e0abe99d7d
3 changed files with 48 additions and 1 deletions
|
@ -505,7 +505,7 @@ class Folder extends Object {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1239,6 +1239,12 @@ class FormHelper extends AppHelper {
|
||||||
* - `type` - Set to 'reset' for reset inputs. Defaults to 'submit'
|
* - `type` - Set to 'reset' for reset inputs. Defaults to 'submit'
|
||||||
* - Other attributes will be assigned to the input element.
|
* - Other attributes will be assigned to the input element.
|
||||||
*
|
*
|
||||||
|
* ### Options
|
||||||
|
*
|
||||||
|
* - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to
|
||||||
|
* FormHelper::input().
|
||||||
|
* - Other attributes will be assigned to the input element.
|
||||||
|
*
|
||||||
* @param string $caption The label appearing on the button OR if string contains :// or the
|
* @param string $caption The label appearing on the button OR if string contains :// or the
|
||||||
* extension .jpg, .jpe, .jpeg, .gif, .png use an image if the extension
|
* extension .jpg, .jpe, .jpeg, .gif, .png use an image if the extension
|
||||||
* exists, AND the first character is /, image is relative to webroot,
|
* exists, AND the first character is /, image is relative to webroot,
|
||||||
|
|
|
@ -80,6 +80,47 @@ class FolderTest extends CakeTestCase {
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test creation of single and mulitple paths.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function testCreation() {
|
||||||
|
$folder =& new Folder(TMP . 'tests');
|
||||||
|
$result = $folder->create(TMP . 'tests' . DS . 'first' . DS . 'second' . DS . 'third');
|
||||||
|
$this->assertTrue($result);
|
||||||
|
|
||||||
|
rmdir(TMP . 'tests' . DS . 'first' . DS . 'second' . DS . 'third');
|
||||||
|
rmdir(TMP . 'tests' . DS . 'first' . DS . 'second');
|
||||||
|
rmdir(TMP . 'tests' . DS . 'first');
|
||||||
|
|
||||||
|
$folder =& new Folder(TMP . 'tests');
|
||||||
|
$result = $folder->create(TMP . 'tests' . DS . 'first');
|
||||||
|
$this->assertTrue($result);
|
||||||
|
rmdir(TMP . 'tests' . DS . 'first');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* test recurisve directory create failure.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function testRecursiveCreateFailure() {
|
||||||
|
if ($this->skipIf(DS == '\\', 'Cant perform operations using permissions on windows. %s')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$path = TMP . 'tests' . DS . 'one';
|
||||||
|
mkdir($path);
|
||||||
|
chmod($path, '0444');
|
||||||
|
|
||||||
|
$this->expectError();
|
||||||
|
|
||||||
|
$folder =& new Folder($path);
|
||||||
|
$result = $folder->create($path . DS . 'two' . DS . 'three');
|
||||||
|
$this->assertFalse($result);
|
||||||
|
|
||||||
|
chmod($path, '0777');
|
||||||
|
rmdir($path);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* testOperations method
|
* testOperations method
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue