예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function create()
 {
     $client = $this->newHttpClient();
     if (!$this->sslVerification) {
         $client->setSslVerification(false, false);
     }
     $job = str_replace('{{ project.name }}', $this->projectName->get(), $this->getConfigTemplate());
     $headers = ['Content-Type' => 'text/xml'];
     $options = ['query' => array('name' => $this->projectName->getName())];
     $client->post($this->url . '/createItem', $headers, $job, $options)->send();
     return true;
 }
예제 #2
0
 /**
  * @param ProjectName $projectName
  * @param GitWrapper $gitWrapper
  */
 public function __construct(ProjectName $projectName, GitWrapper $gitWrapper)
 {
     $this->projectName = $projectName;
     $this->gitWrapper = $gitWrapper;
     $this->fs = new Filesystem();
     // Set the default config values
     $this->setConfig('directory', './' . $this->projectName->getName())->setConfig('label', $projectName->getName())->setConfig('description', '')->setConfig('copyright.year', date('Y'))->setConfig('namespace', $projectName->getNameCamelCased())->setConfig('class', $projectName->getNameCamelCased());
 }
 public function testParseProjectName()
 {
     $projectName = new ProjectName('cpliakas/my-project');
     $this->assertEquals($projectName->getVendor(), 'cpliakas');
     $this->assertEquals($projectName->getName(), 'my-project');
 }