Beispiel #1
0
 public function testAddInput_NonFile()
 {
     $input = new \vc\App\Paths();
     try {
         $input->addInput(\r8\FileSys::create($this->dir . '/NotAFile'));
         $this->fail("An expected exception was not thrown");
     } catch (\r8\Exception\Argument $err) {
     }
 }
Beispiel #2
0
 /**
  * Builds the configuration
  *
  * @return \vc\App\Config
  */
 public function build(\r8\CLI\Result $cli)
 {
     if ($cli->countArgs() < 2) {
         throw new \r8\Exception\Argument(0, 'CLI Args', 'Less than two arguments given');
     }
     $args = $cli->getArgs();
     $output = new \r8\FileSys\Dir(array_shift($args));
     $paths = new \vc\App\Paths();
     foreach ($args as $path) {
         $paths->addInput(\r8\FileSys::create($path));
     }
     return new \vc\App\Config($output, $paths);
 }