5 require_once __DIR__
."/../../autoload.php";
7 use pharext\Cli\Args
as CliArgs
;
8 use pharext\Cli\Command
as CliCommand
;
10 class Cmd
implements Command
13 function __construct() {
14 $this->args
= new CliArgs
;
16 function run($argc, array $argv) {
20 class GitSourceDirTest
extends \PHPUnit_Framework_TestCase
27 protected function setUp() {
28 $this->source
= new SourceDir\
Git(".");
31 public function testGetBaseDir() {
32 $this->assertSame($this->source
->getBaseDir(), ".");
35 public function testIterator() {
36 $git_files = `git ls
-tree
--name
-only
-r HEAD | xargs
-I
{} -n1
echo \$
(pwd
)/{}`
;
37 $dir_files = implode("\n", iterator_to_array($this->source
->getIterator()))."\n";
38 $this->assertSame($git_files, $dir_files);