public function testGetReplacements() { $projectName = new ProjectName('cpliakas/my-project'); $repository = new Repository($projectName, new GitWrapper()); $repository->setConfig('label', 'My Project')->setConfig('description', 'Test description.')->setConfig('copyright.year', '1982')->setConfig('copyright.holders', 'Chris Pliakas')->setConfig('namespace', 'Test\\Namespace'); $replacements = $repository->getReplacements(); $this->assertEquals('cpliakas/my-project', $replacements['{{ project.name }}']); $this->assertEquals('My Project', $replacements['{{ project.label }}']); $this->assertEquals('Test description.', $replacements['{{ project.description }}']); $this->assertEquals('Test\\Namespace', $replacements['{{ project.namespace }}']); $this->assertEquals('Test\\\\Namespace', $replacements['{{ project.namespace.esc }}']); $this->assertEquals('MyProject', $replacements['{{ project.class }}']); $this->assertEquals('1982', $replacements['{{ copyright.year }}']); $this->assertEquals('Chris Pliakas', $replacements['{{ copyright.holders }}']); }
protected function initRepository($dir) { $git = parent::initRepository($dir); $git->config('user.email', '*****@*****.**'); $git->config('user.name', 'Chris Pliakas'); return $git; }