public function testMissingJsonData() { $dir = $GLOBALS['IP'] . '/testMissingJsonData'; $fixture = new GitInfo($dir); $this->assertFalse($fixture->cacheIsComplete()); $this->assertEquals(false, $fixture->getHead()); $this->assertEquals(false, $fixture->getHeadSHA1()); $this->assertEquals(false, $fixture->getHeadCommitDate()); $this->assertEquals(false, $fixture->getCurrentBranch()); $this->assertEquals(false, $fixture->getHeadViewUrl()); // After calling all the outputs, the cache should be complete $this->assertTrue($fixture->cacheIsComplete()); }
/** * @param string $dir Directory of the git checkout * @return bool|string Branch currently checked out */ public static function getGitCurrentBranch($dir) { $repo = new GitInfo($dir); return $repo->getCurrentBranch(); }