From 0df958f81d1ad94a1a778c8967fba9a857784ccc Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 9 Mar 2012 15:00:03 +1300 Subject: [PATCH 1/2] MINOR Fixed tests to use commas as delimiter for shortcodes, also test spaces still work as well --- tests/parsers/ShortcodeParserTest.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/parsers/ShortcodeParserTest.php b/tests/parsers/ShortcodeParserTest.php index f826a2030..17c891c75 100644 --- a/tests/parsers/ShortcodeParserTest.php +++ b/tests/parsers/ShortcodeParserTest.php @@ -20,12 +20,12 @@ class ShortcodeParserTest extends SapphireTest { public function testNotRegisteredShortcode() { $this->assertEquals('[not_shortcode]', $this->parser->parse('[not_shortcode]')); $this->assertEquals('[not_shortcode /]', $this->parser->parse('[not_shortcode /]')); - $this->assertEquals('[not_shortcode foo="bar"]', $this->parser->parse('[not_shortcode foo="bar"]')); + $this->assertEquals('[not_shortcode,foo="bar"]', $this->parser->parse('[not_shortcode,foo="bar"]')); $this->assertEquals('[not_shortcode]a[/not_shortcode]', $this->parser->parse('[not_shortcode]a[/not_shortcode]')); } public function testSimpleTag() { - $tests = array('[test_shortcode]', '[test_shortcode ]', '[test_shortcode/]', '[test_shortcode /]'); + $tests = array('[test_shortcode]', '[test_shortcode ]', '[test_shortcode,]', '[test_shortcode/]', '[test_shortcode /]'); foreach($tests as $test) { $this->parser->parse($test); @@ -38,9 +38,9 @@ class ShortcodeParserTest extends SapphireTest { public function testOneArgument() { $tests = array ( - '[test_shortcode foo="bar"]', - "[test_shortcode foo='bar']", - '[test_shortcode foo = "bar" /]' + '[test_shortcode,foo="bar"]', + "[test_shortcode,foo='bar']", + '[test_shortcode,foo = "bar" /]' ); foreach($tests as $test) { @@ -53,7 +53,7 @@ class ShortcodeParserTest extends SapphireTest { } public function testMultipleArguments() { - $this->parser->parse('[test_shortcode foo = "bar" bar=\'foo\' baz="buz"]'); + $this->parser->parse('[test_shortcode,foo = "bar",bar=\'foo\',baz="buz"]'); $this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', 'baz' => 'buz'), $this->arguments); $this->assertEquals('', $this->contents); @@ -69,7 +69,7 @@ class ShortcodeParserTest extends SapphireTest { } public function testEnclosingWithArguments() { - $this->parser->parse('[test_shortcode foo = "bar" bar=\'foo\' baz="buz"]foo[/test_shortcode]'); + $this->parser->parse('[test_shortcode,foo = "bar",bar=\'foo\',baz="buz"]foo[/test_shortcode]'); $this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', 'baz' => 'buz'), $this->arguments); $this->assertEquals('foo', $this->contents); @@ -86,6 +86,11 @@ class ShortcodeParserTest extends SapphireTest { $this->assertEquals(array('foo' => 'bar', 'baz' => 'buz'), $this->arguments); } + public function testSpacesForDelimiter() { + $this->assertEquals('', $this->parser->parse('[test_shortcode foo=bar baz = buz]')); + $this->assertEquals(array('foo' => 'bar', 'baz' => 'buz'), $this->arguments); + } + public function testSelfClosingTag() { $this->assertEquals ( 'morecontent', From ecb279c33e3fe2b4d86a4575f0af42be65a35f03 Mon Sep 17 00:00:00 2001 From: Robert Curry Date: Fri, 9 Mar 2012 14:44:19 +1300 Subject: [PATCH 2/2] Issue #6667: Check for TEMP_FOLDER _ss_envrionment override in install script. --- dev/install/install.php5 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/install/install.php5 b/dev/install/install.php5 index 3b6cc4e2d..3d0bc8e46 100644 --- a/dev/install/install.php5 +++ b/dev/install/install.php5 @@ -670,7 +670,9 @@ class InstallRequirements { } function getTempFolder() { - if(file_exists($this->getBaseDir() . 'silverstripe-cache')) { + if (defined('TEMP_FOLDER')) { + $sysTmp = TEMP_FOLDER; + } elseif(file_exists($this->getBaseDir() . 'silverstripe-cache')) { $sysTmp = $this->getBaseDir(); } elseif(function_exists('sys_get_temp_dir')) { $sysTmp = sys_get_temp_dir();