/**
  * test that everything works alright no matter if a path-spec is finished with a slash or not
  */
 public function testIfPathEndsWithSlash()
 {
     $images = Tx_CzSimpleCal_Utility_FileArrayBuilder::build('baz.jpg', 'foo/bar/');
     $image = current($images);
     $this->assertEquals('foo/bar/', $image->getPath(), 'ok if already finished with slash');
     $images = Tx_CzSimpleCal_Utility_FileArrayBuilder::build('baz.jpg', 'foo/bar');
     $image = current($images);
     $this->assertEquals('foo/bar/', $image->getPath(), 'ok if not finished with slash');
     $images = Tx_CzSimpleCal_Utility_FileArrayBuilder::build('baz.jpg', '/foo/bar/');
     $image = current($images);
     $this->assertEquals('/foo/bar/', $image->getPath(), 'leading slash is not removed');
 }
Exemple #2
0
 /**
  * get all images as an array
  * 
  * @return array<Tx_CzEwlSponsor_Domain_Model_File>
  */
 public function getImages()
 {
     if (is_null($this->_cache_images)) {
         \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_address');
         $this->_cache_images = Tx_CzSimpleCal_Utility_FileArrayBuilder::build($this->image, $GLOBALS['TCA']['tt_address']['columns']['image']['config']['uploadfolder']);
     }
     return $this->_cache_images;
 }
Exemple #3
0
 /**
  * get all files as an array
  * 
  * @return array<Tx_CzEwlSponsor_Domain_Model_File>
  */
 public function getFiles()
 {
     if (is_null($this->_cache_files)) {
         \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tx_czsimplecal_domain_model_event');
         $this->_cache_files = Tx_CzSimpleCal_Utility_FileArrayBuilder::build($this->files, $GLOBALS['TCA']['tx_czsimplecal_domain_model_event']['columns']['files']['config']['uploadfolder'], '', $this->filesCaption);
     }
     return $this->_cache_files;
 }