示例#1
0
 /**
  * @test
  * @covers Cocur\Watchman\Watch::find()
  */
 public function findFindsFilesThatMatchPattern()
 {
     $this->watchman->shouldReceive('find')->with($this->root, '*.scss')->once();
     $this->watch->find('*.scss');
 }
示例#2
0
 /**
  * Executes the `trigger` command.
  * @param Watch|string $watch     Watch object or path to root.
  * @param string       $name      Trigger name
  * @param string       $patterns  Patterns
  * @param string       $command   Command to execute
  *
  * @return string Name of the added trigger.
  *
  * @throws \RuntimeException if the trigger could not be created.
  */
 public function addTrigger($watch, $name, $patterns, $command)
 {
     if ($watch instanceof Watch) {
         $root = $watch->getRoot();
     } else {
         $root = $watch;
         $watch = new Watch($this, $root);
     }
     $process = $this->processFactory->create(sprintf('%s -- trigger %s %s %s -- %s', $this->binary, $root, $name, $patterns, $command));
     return new Trigger($watch, $this->runProcess($process)['triggerid']);
 }