Example #1
0
 /**
  * Get directories tree array
  *
  * @return array
  */
 public function getTreeArray()
 {
     $directories = $this->getDirsCollection($this->_helper->getCurrentPath());
     $resultArray = [];
     foreach ($directories as $path) {
         $resultArray[] = ['text' => $this->_helper->getShortFilename(pathinfo($path, PATHINFO_BASENAME), 20), 'id' => $this->_helper->convertPathToId($path), 'cls' => 'folder'];
     }
     return $resultArray;
 }
Example #2
0
 /**
  * @covers \Magento\Theme\Helper\Storage::getShortFilename
  * @covers \Magento\Theme\Helper\Storage::__construct
  */
 public function testGetShortFilename()
 {
     $longFileName = 'veryLongFileNameMoreThanTwenty';
     $expectedFileName = 'veryLongFileNameMore...';
     $this->assertEquals($expectedFileName, $this->helper->getShortFilename($longFileName, 20));
 }