commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / tests / phpunit / CRM / Utils / FileTest.php
1 <?php
2 require_once 'CiviTest/CiviUnitTestCase.php';
3
4 /**
5 * Class CRM_Utils_FileTest
6 */
7 class CRM_Utils_FileTest extends CiviUnitTestCase {
8 public function testIsChildPath() {
9 $testCases = array();
10 $testCases[] = array('/ab/cd/ef', '/ab/cd', FALSE);
11 $testCases[] = array('/ab/cd', '/ab/cd/ef', TRUE);
12 $testCases[] = array('/ab/cde', '/ab/cd/ef', FALSE);
13 $testCases[] = array('/ab/cde', '/ab/cd', FALSE);
14 $testCases[] = array('/ab/cd', 'ab/cd/ef', FALSE);
15 foreach ($testCases as $testCase) {
16 $actual = CRM_Utils_File::isChildPath($testCase[0], $testCase[1], FALSE);
17 $this->assertEquals($testCase[2], $actual, sprintf("parent=[%s] child=[%s] expected=[%s] actual=[%s]",
18 $testCase[0], $testCase[1], $testCase[2], $actual
19 ));
20 }
21 }
22
23 }