Example #1
0
 /**
  * @test
  */
 public function shouldBeAbleToForkAPackage()
 {
     $package = $this->getMockedPackage();
     $githubClient = $this->prepareMockedGithubClient($package);
     $command = new ForkPackage($githubClient, $this->eventDispatcher);
     $command->execute($package);
 }
Example #2
0
 public function execute(Package $package, $dryRun = false)
 {
     $client = $this->getAuthenticateGitHubClient();
     $gitWrapper = $this->getGitWrapper();
     $step = new Step\ForkPackage($client, $this->dispatcher);
     $repository = $step->execute($package);
     sleep(180);
     $localPackage = new LocalPackage($repository, $this->sanitizeLocallyDir($package), $package);
     $step = new Step\CloneLocally($gitWrapper, $this->dispatcher);
     $step->execute($localPackage);
     $step = new Step\ExecuteCSFixer($this->phpCsFixerBin, 4000, $this->dispatcher);
     $step->execute($localPackage);
     if (!$dryRun) {
         $step = new Step\CommitAndPush($this->dispatcher);
         $git = $this->getGitWorking($gitWrapper, $localPackage);
         $step->execute($git, $localPackage);
         $step = new Step\MakeAPR($client, new FunnyMessageRepository(), $this->dispatcher);
         $step->execute($localPackage);
     }
     return $localPackage;
 }