From bf6337c59a291124985a4ea6b490c304193d7b25 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 7 Jan 2016 10:34:01 +1300 Subject: [PATCH] FIX: Changes needed to respond to whitespace changes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’ve made the ContentControllerTest whitespace agnostic, as it’s possible that we change the whitespace semantics of includes in SS4 and I don’t want to make this test brittle to that. --- tests/controller/ContentControllerTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/controller/ContentControllerTest.php b/tests/controller/ContentControllerTest.php index 45b19726..ce2c4a21 100755 --- a/tests/controller/ContentControllerTest.php +++ b/tests/controller/ContentControllerTest.php @@ -149,8 +149,8 @@ class ContentControllerTest extends FunctionalTest { $page->publish("Stage", "Live"); $response = $self->get($page->RelativeLink()); - $self->assertEquals("ContentControllerTestPageWithoutController", $response->getBody()); - + $self->assertEquals("ContentControllerTestPageWithoutController", trim($response->getBody())); + // // This should fall over to user Page.ss $page = new ContentControllerTestPage(); $page->URLSegment = "test"; @@ -158,7 +158,7 @@ class ContentControllerTest extends FunctionalTest { $page->publish("Stage", "Live"); $response = $self->get($page->RelativeLink()); - $self->assertEquals("Page", $response->getBody()); + $self->assertEquals("Page", trim($response->getBody())); // Test that the action template is rendered. @@ -168,12 +168,12 @@ class ContentControllerTest extends FunctionalTest { $page->publish("Stage", "Live"); $response = $self->get($page->RelativeLink("test")); - $self->assertEquals("ContentControllerTestPage_test", $response->getBody()); + $self->assertEquals("ContentControllerTestPage_test", trim($response->getBody())); // Test that an action without a template will default to the index template, which is // to say the default Page.ss template $response = $self->get($page->RelativeLink("testwithouttemplate")); - $self->assertEquals("Page", $response->getBody()); + $self->assertEquals("Page", trim($response->getBody())); // Test that an action with a template will render the both action template *and* the // correct parent template