Example #1
0
 public function extend(Run $gasp)
 {
     $gasp->classMap('phpunit', new ClassMap());
     /**
      * Add an alias to the runTests tasks, because it's by far the most
      * common task people will run from this extension.
      */
     $gasp->task('phpunit', 'phpunit.runTests');
 }
Example #2
0
 public function testInvalidJsonInPhpcsResultsCausesFailure()
 {
     $gasp = new Run();
     $sniff = $this->getMock('\\Gasp\\Task\\CodeSniffer', array('execPhpcs'), array());
     $result = $gasp->result();
     $result->setStatus('fail')->setOutput('{{{{{{{{');
     $sniff->expects($this->once())->method('execPhpcs')->will($this->returnValue($result));
     /* @var $sniff \Gasp\Task\CodeSniffer */
     $sniff->setGasp($gasp)->setPhpcs('./vendor/bin/phpcs')->setPaths([__DIR__ . '/sniff-test-files/all-valid']);
     $this->assertTrue($sniff->run()->isFailure());
 }
Example #3
0
 /**
  * Handle undefined methods by attempting to instantiate the task matching the
  * method name.
  *
  * @param string $method
  * @param array $args
  * @return mixed
  */
 public function __call($method, array $args)
 {
     if (!$this->gasp) {
         throw new Exception('Must set a gasp instance before creating tasks.');
     }
     $method = strtolower($method);
     $task = $this->factory($method, $args);
     $task->setGasp($this->gasp);
     if ('default' === $this->name) {
         $this->gasp->registerTaskInstance($method, $task);
     } else {
         $this->gasp->registerTaskInstance($this->name . '.' . $method, $task);
     }
     return $task;
 }
Example #4
0
 public function extend(Run $gasp)
 {
     $gasp->classMap('ssh', new ClassMap());
 }