2 require_once 'CiviTest/CiviUnitTestCase.php';
5 * Class CRM_Utils_FileTest
7 class CRM_Utils_FileTest
extends CiviUnitTestCase
{
8 public function testIsChildPath() {
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