From e4b563e596ad33a2dc4d360cd40977c53cda7b30 Mon Sep 17 00:00:00 2001 From: Nightjar Date: Sun, 31 Aug 2014 16:37:08 +0100 Subject: [PATCH] Fixing the failure of some tests if the framework dir is named something other than 'framework' (which is a legitimate option) --- tests/forms/RequirementsTest.php | 1 - tests/view/SSViewerTest.php | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/forms/RequirementsTest.php b/tests/forms/RequirementsTest.php index f19cc4afb..93eccbe7a 100644 --- a/tests/forms/RequirementsTest.php +++ b/tests/forms/RequirementsTest.php @@ -405,7 +405,6 @@ class RequirementsTest extends SapphireTest { public function testSuffix() { $template = '
My header

Body

'; $basePath = $this->getCurrentRelativePath(); - $basePath = 'framework' . substr($basePath, strlen(FRAMEWORK_DIR)); $backend = new Requirements_Backend; diff --git a/tests/view/SSViewerTest.php b/tests/view/SSViewerTest.php index b679c48bb..f7edf6161 100644 --- a/tests/view/SSViewerTest.php +++ b/tests/view/SSViewerTest.php @@ -1261,14 +1261,21 @@ after') } public function testRequireCallInTemplateInclude() { - $template = new SSViewer(array('SSViewerTestProcess')); + //TODO undo skip test on the event that templates ever obtain the ability to reference MODULE_DIR (or something to that effect) + if(FRAMEWORK_DIR === 'framework') { + $template = new SSViewer(array('SSViewerTestProcess')); - Requirements::set_suffix_requirements(false); + Requirements::set_suffix_requirements(false); - $this->assertEquals(1, substr_count( - $template->process(array()), - "tests/forms/RequirementsTest_a.js" - )); + $this->assertEquals(1, substr_count( + $template->process(array()), + "tests/forms/RequirementsTest_a.js" + )); + } + else { + $this->markTestSkipped('Requirement will always fail if the framework dir is not '. + 'named \'framework\', since templates require hard coded paths'); + } } public function testCallsWithArguments() {