Completed
Push — master ( 558147...cb90ae )
by Werner
15:43
created
tests/RootFolderTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
         $folder = $page->RootFolder();
26 26
 
27 27
         $this->assertEquals($page->URLSegment, $folder->Name, 'Page URLSegment and Folder Title should be the same');
28
-        $path = ASSETS_DIR . '/' . $root = Config::inst()->get('RootFolder', 'folder_root') . '/'
29
-                . $page->URLSegment . '/';
28
+        $path = ASSETS_DIR.'/'.$root = Config::inst()->get('RootFolder', 'folder_root').'/'
29
+                . $page->URLSegment.'/';
30 30
 
31 31
         $this->assertEquals(
32 32
             $path,
33 33
             $folder->getRelativePath(),
34
-            'folder path should be assets/Articles/' . $page->URLSegment
34
+            'folder path should be assets/Articles/'.$page->URLSegment
35 35
         );
36 36
     }
37 37
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             $this->assertEquals(
72 72
                 0,
73 73
                 $page->RootFolderID,
74
-                'Ignored page type ' . $type . ' should not have a RootFolderID'
74
+                'Ignored page type '.$type.' should not have a RootFolderID'
75 75
             );
76 76
         }
77 77
     }
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
         $this->assertEquals($parent->ID, $child->ParentID, 'subpage should be a child of parentpage');
119 119
 
120 120
         $this->assertStringEndsWith(
121
-            $child->RootFolder()->Name . '/',
121
+            $child->RootFolder()->Name.'/',
122 122
             $child->getRootFolderName(),
123 123
             'FolderName should be at the end of getRootFolderName()'
124 124
         );
125 125
 
126 126
         $root = Config::inst()->get('RootFolder', 'folder_root');
127 127
         $this->assertStringStartsWith(
128
-            $root . '/' . $parent->RootFolder()->Name,
128
+            $root.'/'.$parent->RootFolder()->Name,
129 129
             $child->getRootFolderName(),
130 130
             'Parents FolderName should be at the beginning of getRootFolderName()'
131 131
         );
Please login to merge, or discard this patch.
code/RootFolder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
             $folderRoot = $parent->getRootFolderName();
100 100
         } else {
101 101
             //fallback to classes folder_root which is defined in your config.yml
102
-            $folderRoot = $this->getFolderRoot() . '/';
102
+            $folderRoot = $this->getFolderRoot().'/';
103 103
         }
104 104
 
105 105
         if ($folderRoot == '/') {
106
-            $folderRoot = getFolderRoot() . '/';
106
+            $folderRoot = getFolderRoot().'/';
107 107
         }
108 108
 
109
-        $folder = Folder::find_or_make($folderRoot . $this->getOrCreateURLSegment());
109
+        $folder = Folder::find_or_make($folderRoot.$this->getOrCreateURLSegment());
110 110
         $folder->Title = $this->owner->Title;
111 111
         $folder->setName($this->owner->URLSegment);
112 112
         $folder->write();
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     {
163 163
         if ($this->owner->RootFolderID) {
164 164
             return $relativeToAssetsDir
165
-                ? str_replace(ASSETS_DIR . '/', '', $this->owner->RootFolder()->getRelativePath())
165
+                ? str_replace(ASSETS_DIR.'/', '', $this->owner->RootFolder()->getRelativePath())
166 166
                 : $this->owner->RootFolder()->getRelativePath();
167 167
         } else {
168 168
             //use folder root as fallback for now
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         // Ensure that this object has a non-conflicting URLSegment value.
199 199
         $count = 2;
200 200
         while (!$this->owner->validURLSegment()) {
201
-            $this->owner->URLSegment = preg_replace('/-[0-9]+$/', null, $this->owner->URLSegment) . '-' . $count;
201
+            $this->owner->URLSegment = preg_replace('/-[0-9]+$/', null, $this->owner->URLSegment).'-'.$count;
202 202
             $count++;
203 203
         }
204 204
 
Please login to merge, or discard this patch.