/** * testSubmodule */ public function testSubmodule() { $tempDir = realpath(sys_get_temp_dir()) . 'gitelephant_' . md5(uniqid(rand(), 1)); $tempName = tempnam($tempDir, 'gitelephant'); $path = $tempName; unlink($path); mkdir($path); $repository = new Repository($path); $repository->init(); $repository->addSubmodule($this->repository->getPath()); $repository->commit('test', true); $tree = $repository->getTree(); $this->assertContains('.gitmodules', $tree); $this->assertContains($this->repository->getHumanishName(), $tree); $submodule = $tree[0]; $this->assertEquals(Object::TYPE_LINK, $submodule->getType()); }