Merge branch 'master' into 2.6

This commit is contained in:
mark_story 2014-10-30 21:20:53 -04:00
commit 579b16d90b
5 changed files with 44 additions and 8 deletions

View file

@ -789,6 +789,9 @@ class Mysql extends DboSource {
if (strpos($col, 'enum') !== false) {
return "enum($vals)";
}
if (strpos($col, 'set') !== false) {
return "set($vals)";
}
return 'text';
}

View file

@ -170,6 +170,22 @@ class FolderTest extends CakeTestCase {
$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.
*

View file

@ -314,6 +314,16 @@ class TextHelperTest extends CakeTestCase {
* @return void
*/
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';
$expected = 'Text with a partial <a href="http://www.cakephp.org">link</a> link';
$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';
$expected = 'Text with a url &lt;a href=&quot;http://www.not-working-www.com&quot;&gt;www.not-working-www.com&lt;/a&gt; and more';
$result = $this->Text->autoLinkUrls($text);
$result = $this->Text->autoLinkUrls($text, array('escape' => true));
$this->assertEquals($expected, $result);
$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';
$result = $this->Text->autoLinkUrls($text);
$result = $this->Text->autoLinkUrls($text, array('escape' => false));
$this->assertEquals($expected, $result);
$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';
$result = $this->Text->autoLinkUrls($text);
$result = $this->Text->autoLinkUrls($text, array('escape' => false));
$this->assertEquals($expected, $result);
$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';
$result = $this->Text->autoLinkUrls($text);
$result = $this->Text->autoLinkUrls($text, array('escape' => false));
$this->assertEquals($expected, $result);
}

View file

@ -509,10 +509,13 @@ class Folder {
}
/**
* Create a directory structure recursively. Can be used to create
* deep path structures like `/foo/bar/baz/shoe/horn`
* Create a directory structure recursively.
*
* @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
* @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
@ -522,6 +525,10 @@ class Folder {
return true;
}
if (!self::isAbsolute($pathname)) {
$pathname = self::addPathElement($this->pwd(), $pathname);
}
if (!$mode) {
$mode = $this->mode;
}

View file

@ -45,7 +45,7 @@ App::uses('Debugger', 'Utility');
if (!empty($stack['args'])):
foreach ((array)$stack['args'] as $arg):
$args[] = Debugger::getType($arg);
$params[] = Debugger::exportVar($arg, 2);
$params[] = Debugger::exportVar($arg, 4);
endforeach;
endif;