예제 #1
0
파일: Folder.php 프로젝트: tgr0ss/cakephp
 /**
  * Returns $path with added terminating slash (corrected for Windows or other OS).
  *
  * @param string $path Path to check
  * @return string Path with ending slash
  */
 public static function slashTerm($path)
 {
     if (Folder::isSlashTerm($path)) {
         return $path;
     }
     return $path . Folder::correctSlashFor($path);
 }
예제 #2
0
 /**
  * correctSlashFor method
  *
  * @return void
  */
 public function testCorrectSlashFor()
 {
     $path = '/path/to/file';
     $result = Folder::correctSlashFor($path);
     $this->assertEquals('/', $result);
     $path = '\\path\\to\\file';
     $result = Folder::correctSlashFor($path);
     $this->assertEquals('/', $result);
     $path = 'C:\\path\\to\\file';
     $result = Folder::correctSlashFor($path);
     $this->assertEquals('\\', $result);
 }