mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge branch 'master' into 2.6
This commit is contained in:
commit
579b16d90b
5 changed files with 44 additions and 8 deletions
|
@ -789,6 +789,9 @@ class Mysql extends DboSource {
|
||||||
if (strpos($col, 'enum') !== false) {
|
if (strpos($col, 'enum') !== false) {
|
||||||
return "enum($vals)";
|
return "enum($vals)";
|
||||||
}
|
}
|
||||||
|
if (strpos($col, 'set') !== false) {
|
||||||
|
return "set($vals)";
|
||||||
|
}
|
||||||
return 'text';
|
return 'text';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,22 @@ class FolderTest extends CakeTestCase {
|
||||||
$this->assertTrue($Folder->delete());
|
$this->assertTrue($Folder->delete());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that relative paths to create() are added to cwd.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testCreateRelative() {
|
||||||
|
$folder = new Folder(TMP);
|
||||||
|
$path = TMP . 'tests' . DS . 'relative-test';
|
||||||
|
$result = $folder->create('tests' . DS . 'relative-test');
|
||||||
|
$this->assertTrue($result, 'should create');
|
||||||
|
|
||||||
|
$this->assertTrue(is_dir($path), 'Folder was not made');
|
||||||
|
$folder = new Folder($path);
|
||||||
|
$folder->delete();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test recursive directory create failure.
|
* test recursive directory create failure.
|
||||||
*
|
*
|
||||||
|
|
|
@ -314,6 +314,16 @@ class TextHelperTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testAutoLinkUrlsEscape() {
|
public function testAutoLinkUrlsEscape() {
|
||||||
|
$text = 'Text with a partial <a href="http://www.example.com">http://www.example.com</a> link';
|
||||||
|
$expected = 'Text with a partial <a href="http://www.example.com">http://www.example.com</a> link';
|
||||||
|
$result = $this->Text->autoLinkUrls($text, array('escape' => false));
|
||||||
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
$text = 'Text with a partial <a href="http://www.example.com">www.example.com</a> link';
|
||||||
|
$expected = 'Text with a partial <a href="http://www.example.com">www.example.com</a> link';
|
||||||
|
$result = $this->Text->autoLinkUrls($text, array('escape' => false));
|
||||||
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$text = 'Text with a partial <a href="http://www.cakephp.org">link</a> link';
|
$text = 'Text with a partial <a href="http://www.cakephp.org">link</a> link';
|
||||||
$expected = 'Text with a partial <a href="http://www.cakephp.org">link</a> link';
|
$expected = 'Text with a partial <a href="http://www.cakephp.org">link</a> link';
|
||||||
$result = $this->Text->autoLinkUrls($text, array('escape' => false));
|
$result = $this->Text->autoLinkUrls($text, array('escape' => false));
|
||||||
|
@ -331,22 +341,22 @@ class TextHelperTest extends CakeTestCase {
|
||||||
|
|
||||||
$text = 'Text with a url <a href="http://www.not-working-www.com">www.not-working-www.com</a> and more';
|
$text = 'Text with a url <a href="http://www.not-working-www.com">www.not-working-www.com</a> and more';
|
||||||
$expected = 'Text with a url <a href="http://www.not-working-www.com">www.not-working-www.com</a> and more';
|
$expected = 'Text with a url <a href="http://www.not-working-www.com">www.not-working-www.com</a> and more';
|
||||||
$result = $this->Text->autoLinkUrls($text);
|
$result = $this->Text->autoLinkUrls($text, array('escape' => true));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$text = 'Text with a url www.not-working-www.com and more';
|
$text = 'Text with a url www.not-working-www.com and more';
|
||||||
$expected = 'Text with a url <a href="http://www.not-working-www.com">www.not-working-www.com</a> and more';
|
$expected = 'Text with a url <a href="http://www.not-working-www.com">www.not-working-www.com</a> and more';
|
||||||
$result = $this->Text->autoLinkUrls($text);
|
$result = $this->Text->autoLinkUrls($text, array('escape' => false));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$text = 'Text with a url http://www.not-working-www.com and more';
|
$text = 'Text with a url http://www.not-working-www.com and more';
|
||||||
$expected = 'Text with a url <a href="http://www.not-working-www.com">http://www.not-working-www.com</a> and more';
|
$expected = 'Text with a url <a href="http://www.not-working-www.com">http://www.not-working-www.com</a> and more';
|
||||||
$result = $this->Text->autoLinkUrls($text);
|
$result = $this->Text->autoLinkUrls($text, array('escape' => false));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$text = 'Text with a url http://www.www.not-working-www.com and more';
|
$text = 'Text with a url http://www.www.not-working-www.com and more';
|
||||||
$expected = 'Text with a url <a href="http://www.www.not-working-www.com">http://www.www.not-working-www.com</a> and more';
|
$expected = 'Text with a url <a href="http://www.www.not-working-www.com">http://www.www.not-working-www.com</a> and more';
|
||||||
$result = $this->Text->autoLinkUrls($text);
|
$result = $this->Text->autoLinkUrls($text, array('escape' => false));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -509,10 +509,13 @@ class Folder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a directory structure recursively. Can be used to create
|
* Create a directory structure recursively.
|
||||||
* deep path structures like `/foo/bar/baz/shoe/horn`
|
|
||||||
*
|
*
|
||||||
* @param string $pathname The directory structure to create
|
* Can be used to create deep path structures like `/foo/bar/baz/shoe/horn`
|
||||||
|
*
|
||||||
|
* @param string $pathname The directory structure to create. Either an absolute or relative
|
||||||
|
* path. If the path is relative and exists in the process' cwd it will not be created.
|
||||||
|
* Otherwise relative paths will be prefixed with the current pwd().
|
||||||
* @param int $mode octal value 0755
|
* @param int $mode octal value 0755
|
||||||
* @return bool Returns TRUE on success, FALSE on failure
|
* @return bool Returns TRUE on success, FALSE on failure
|
||||||
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::create
|
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::create
|
||||||
|
@ -522,6 +525,10 @@ class Folder {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!self::isAbsolute($pathname)) {
|
||||||
|
$pathname = self::addPathElement($this->pwd(), $pathname);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$mode) {
|
if (!$mode) {
|
||||||
$mode = $this->mode;
|
$mode = $this->mode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ App::uses('Debugger', 'Utility');
|
||||||
if (!empty($stack['args'])):
|
if (!empty($stack['args'])):
|
||||||
foreach ((array)$stack['args'] as $arg):
|
foreach ((array)$stack['args'] as $arg):
|
||||||
$args[] = Debugger::getType($arg);
|
$args[] = Debugger::getType($arg);
|
||||||
$params[] = Debugger::exportVar($arg, 2);
|
$params[] = Debugger::exportVar($arg, 4);
|
||||||
endforeach;
|
endforeach;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue