Completed
Push — AUTOMATED_TESTING ( 49945f...06d095 )
by Gordon
05:14
created
code/PageControllerTemplateOverrideExtension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
 	 */
16 16
 	function useTemplateOverride($data = null) {
17 17
 		$template = $this->owner->AlternativeTemplate;
18
-		if ( isset($template) && $template != '' ) {
18
+		if (isset($template) && $template != '') {
19 19
 			if ($data) {
20 20
 				return $this->owner->customise(new ArrayData($data))
21
-						->renderWith( array( $this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page' ) );
21
+						->renderWith(array($this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page'));
22 22
 			} else {
23
-				return $this->owner->renderWith( array( $this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page' ) );
23
+				return $this->owner->renderWith(array($this->owner->AlternativeTemplate, $this->owner->ClassName, 'Page'));
24 24
 			}
25 25
 
26 26
 		} else {
Please login to merge, or discard this patch.
code/TemplateOverrideExtension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 
12 12
 	public function updateCMSFields(FieldList $fields) {
13 13
 		$templatei18n = _t('TemplateOverride.TEMPLATE', 'Template');
14
-		$fields->addFieldToTab( 'Root.'.$templatei18n, new TextField( 'AlternativeTemplate',
15
-				_t('TemplateOverride.ALTERNATIVE_TEMPLATE_NAME', 'Alternative template name') ) );
14
+		$fields->addFieldToTab('Root.'.$templatei18n, new TextField('AlternativeTemplate',
15
+				_t('TemplateOverride.ALTERNATIVE_TEMPLATE_NAME', 'Alternative template name')));
16 16
 
17 17
 		$info_field = new LiteralField(
18 18
 			$name = 'infofield',
@@ -22,6 +22,6 @@  discard block
 block discarded – undo
22 22
 						' require changing.').'</p>'
23 23
 		);
24 24
 
25
-		$fields->addFieldToTab( 'Root.'.$templatei18n, $info_field );
25
+		$fields->addFieldToTab('Root.'.$templatei18n, $info_field);
26 26
 	}
27 27
 }
Please login to merge, or discard this patch.
tests/PageControllerTemplateOverrideExtensionTest.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 		$page->write();
12 12
 		$page->doPublish();
13 13
 		$response = $this->get('/' . $page->URLSegment);
14
-        $this->assertEquals(200, $response->getStatusCode());
14
+		$this->assertEquals(200, $response->getStatusCode());
15 15
 
16
-        // assert the the inner layout template has been used
17
-        $this->assertExactMatchBySelector("div.marker", array(
18
-		    "INNER LAYOUT"
16
+		// assert the the inner layout template has been used
17
+		$this->assertExactMatchBySelector("div.marker", array(
18
+			"INNER LAYOUT"
19 19
 		));
20 20
 	}
21 21
 
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 		$page->write();
28 28
 		$page->doPublish();
29 29
 		$response = $this->get('/' . $page->URLSegment);
30
-        $this->assertEquals(200, $response->getStatusCode());
30
+		$this->assertEquals(200, $response->getStatusCode());
31 31
 
32
-        // show the the outer layout template has been used
33
-        $this->assertExactMatchBySelector("div.marker", array(
34
-		    "OUTER OF LAYOUT"
32
+		// show the the outer layout template has been used
33
+		$this->assertExactMatchBySelector("div.marker", array(
34
+			"OUTER OF LAYOUT"
35 35
 		));
36 36
 	}
37 37
 
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 		$page->write();
44 44
 		$page->doPublish();
45 45
 		$response = $this->get('/' . $page->URLSegment);
46
-        $this->assertEquals(200, $response->getStatusCode());
47
-        $body = $response->getBody();
48
-        $this->assertNotContains('OUTER OF LAYOUT', $body);
49
-        $this->assertNotContains('INNER LAYOUT', $body);
46
+		$this->assertEquals(200, $response->getStatusCode());
47
+		$body = $response->getBody();
48
+		$this->assertNotContains('OUTER OF LAYOUT', $body);
49
+		$this->assertNotContains('INNER LAYOUT', $body);
50 50
 	}
51 51
 
52 52
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 		$page->AlternativeTemplate = 'PageInnerTest';
11 11
 		$page->write();
12 12
 		$page->doPublish();
13
-		$response = $this->get('/' . $page->URLSegment);
13
+		$response = $this->get('/'.$page->URLSegment);
14 14
         $this->assertEquals(200, $response->getStatusCode());
15 15
 
16 16
         // assert the the inner layout template has been used
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		$page->AlternativeTemplate = 'PageOuterTest';
27 27
 		$page->write();
28 28
 		$page->doPublish();
29
-		$response = $this->get('/' . $page->URLSegment);
29
+		$response = $this->get('/'.$page->URLSegment);
30 30
         $this->assertEquals(200, $response->getStatusCode());
31 31
 
32 32
         // show the the outer layout template has been used
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		$page->AlternativeTemplate = null;
43 43
 		$page->write();
44 44
 		$page->doPublish();
45
-		$response = $this->get('/' . $page->URLSegment);
45
+		$response = $this->get('/'.$page->URLSegment);
46 46
         $this->assertEquals(200, $response->getStatusCode());
47 47
         $body = $response->getBody();
48 48
         $this->assertNotContains('OUTER OF LAYOUT', $body);
Please login to merge, or discard this patch.