#!/usr/bin/env php loadYaml('repo_setreporoot', false, 2)->gen(6); su('admin'); $gitTest = new gitModelTest(); $normalRepo = new stdclass(); $normalRepo->path = '/home/git/normal'; $specialRepo = new stdclass(); $specialRepo->path = '/path/with-special_chars'; $chineseRepo = new stdclass(); $chineseRepo->path = '/路径/包含中文字符'; $emptyRepo = new stdclass(); $emptyRepo->path = ''; $longRepo = new stdclass(); $longRepo->path = '/very/long/path/that/contains/many/levels/of/directories/and/subdirectories/to/test/long/path/handling'; $spaceRepo = new stdclass(); $spaceRepo->path = '/path with spaces'; r($gitTest->setRepoRootTest($normalRepo)) && p() && e('/home/git/normal'); r($gitTest->setRepoRootTest($specialRepo)) && p() && e('/path/with-special_chars'); r($gitTest->setRepoRootTest($chineseRepo)) && p() && e('/路径/包含中文字符'); r($gitTest->setRepoRootTest($emptyRepo)) && p() && e('0'); r($gitTest->setRepoRootTest($longRepo)) && p() && e('/very/long/path/that/contains/many/levels/of/directories/and/subdirectories/to/test/long/path/handling'); r($gitTest->setRepoRootTest($spaceRepo)) && p() && e('/path with spaces');