Skip to content

Commit dbefeef

Browse files
harm-lessharm-less
harm-less
authored and
harm-less
committed
getBasePaths() added to RootDirCollection
- Added a method called getBasePaths() to RootDirCollection because it was missing
1 parent da1c521 commit dbefeef

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/FQ/collections/RootDirCollection.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,15 @@ public function getDirByIndex($index) {
6262
public function dirs() {
6363
return parent::dirs();
6464
}
65+
66+
/**
67+
* @return string[]
68+
*/
69+
public function getBasePaths() {
70+
$paths = array();
71+
foreach ($this->dirs() as $dir) {
72+
$paths[] = $dir->basePath();
73+
};
74+
return $paths;
75+
}
6576
}

tests/FQ/Tests/Collections/RootDirCollectionTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,9 @@ public function testGetDirByIndex() {
6565
$dir = $this->_addDirToCollection();
6666
$this->assertEquals($dir, $this->dirCollection()->getDirByIndex(0));
6767
}
68+
69+
public function testGetBasePaths() {
70+
$this->_addDirToCollection();
71+
$this->assertEquals(array(self::ROOT_DIR_DEFAULT_BASE_PATH), $this->dirCollection()->getBasePaths());
72+
}
6873
}

0 commit comments

Comments
 (0)