5 require_once __DIR__
."/../../autoload.php";
7 class Cmd
implements Command
10 function __construct() {
11 $this->args
= new CliArgs
;
13 function run($argc, array $argv) {
17 class GitSourceDirTest
extends \PHPUnit_Framework_TestCase
24 protected function setUp() {
25 $this->source
= new GitSourceDir(new Cmd
, ".");
28 public function testGetBaseDir() {
29 $this->assertSame($this->source
->getBaseDir(), ".");
32 public function testIterator() {
33 $git_files = `git ls
-files | xargs
-I
{} -n1
echo \$
(pwd
)/{}`
;
34 $dir_files = implode("\n", iterator_to_array($this->source
->getIterator()))."\n";
35 $this->assertSame($git_files, $dir_files);