#!/usr/bin/env php gen(5); zenData('repo')->loadYaml('repo')->gen(1); $gitlab = new gitlabModelTest(); $path = ''; $branch = ''; r($gitlab->getFileLastCommitTest($path, $branch)) && p() && e('0'); // 空的路径和分支 $branch = 'test_error'; r($gitlab->getFileLastCommitTest($path, $branch)) && p() && e('0'); // 错误的分支 $branch = 'master'; r($gitlab->getFileLastCommitTest($path, $branch)) && p('sha') && e('1b9405639ddef9585b3743b0637b4f79775409b7'); // 正确的分支 $path = 'test_error'; r($gitlab->getFileLastCommitTest($path, $branch)) && p() && e('0'); // 错误的路径 $path = 'README.md'; r($gitlab->getFileLastCommitTest($path, $branch)) && p('sha') && e('2e0dd521b4a29930d5670a2c142a4400d7cffc1a'); // 正确的路径 $path = '/public'; r($gitlab->getFileLastCommitTest($path, $branch)) && p('sha') && e('0fd3978da3be5969ef39ff2517cc69cb3a23811c'); // 带/的路径 $path = '/public/'; r($gitlab->getFileLastCommitTest($path, $branch)) && p('sha') && e('0fd3978da3be5969ef39ff2517cc69cb3a23811c'); // 带/的路径