Changeset 23609 for branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_isAbsoluteRealPathTest.php
- Timestamp:
- 2014/08/28 15:58:05 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_isAbsoluteRealPathTest.php
r23546 r23609 36 36 37 37 38 protected function setUp()39 {40 // parent::setUp();41 }38 protected function setUp() 39 { 40 // parent::setUp(); 41 } 42 42 43 protected function tearDown()44 {45 // parent::tearDown();46 }43 protected function tearDown() 44 { 45 // parent::tearDown(); 46 } 47 47 48 /////////////////////////////////////////49 public function testIsAbsoluteRealPath_絶対パスの場合_trueが返る()50 {48 ///////////////////////////////////////// 49 public function testIsAbsoluteRealPath_絶対パスの場合_trueが返る() 50 { 51 51 52 if (strpos(PHP_OS, 'WIN')) { 53 $input = 'C:/Program Files/username/hoge/hoge.txt'; 54 } else { 55 $input = '/etc/php.ini'; 52 if (strpos(PHP_OS, 'WIN')) { 53 $input = 'C:/Program Files/username/hoge/hoge.txt'; 54 } else { 55 $input = '/etc/php.ini'; 56 } 57 $this->expected = true; 58 $this->actual = SC_Utils::isAbsoluteRealPath($input); 59 60 $this->verify(); 56 61 } 57 $this->expected = true;58 $this->actual = SC_Utils::isAbsoluteRealPath($input);59 62 60 $this->verify();61 }63 public function testIsAbsoluteRealPath_相対パスの場合_trueが返る() 64 { 62 65 63 public function testIsAbsoluteRealPath_相対パスの場合_trueが返る() 64 { 66 if (strpos(PHP_OS, 'WIN')) { 67 $input = './system32/hoge/hoge.txt'; 68 } else { 69 $input = '../etc/php.ini'; 70 } 71 $this->expected = false; 72 $this->actual = SC_Utils::isAbsoluteRealPath($input); 65 73 66 if (strpos(PHP_OS, 'WIN')) { 67 $input = './system32/hoge/hoge.txt'; 68 } else { 69 $input = '../etc/php.ini'; 74 $this->verify(); 70 75 } 71 $this->expected = false;72 $this->actual = SC_Utils::isAbsoluteRealPath($input);73 76 74 $this->verify();75 }76 77 77 ////////////////////////////////////////// 78 public function testIsAbsoluteRealPath_絶対パスに相対パスが混じっている場合_falseが返る() 79 { 80 if (strpos(PHP_OS, 'WIN')) { 81 $input = 'C:/path/to/eccube/html/../data/hoge.txt'; 82 } else { 83 $input = '/path/to/eccube/html/../data/hoge.txt'; 84 } 85 $this->expected = false; 86 $this->actual = SC_Utils::isAbsoluteRealPath($input); 87 88 $this->verify(); 89 } 90 91 ////////////////////////////////////////// 78 92 } 79
Note: See TracChangeset
for help on using the changeset viewer.