示例#1
0
 /**
  * @param Filesystem                  $files
  * @param ServiceInterpreterInterface $interpreter
  * @param ResponseMergerInterface     $responseMerger
  * @param Ssh2SftpConnectionInterface $sshConnection        optional
  */
 public function __construct(Filesystem $files = null, ServiceInterpreterInterface $interpreter = null, ResponseMergerInterface $responseMerger = null, Ssh2SftpConnectionInterface $sshConnection = null)
 {
     if (!is_null($sshConnection)) {
         $this->ssh = $sshConnection;
     }
     parent::__construct($files, $interpreter, $responseMerger);
 }
 /**
  * @test
  */
 function it_throws_an_exception_on_invalid_config()
 {
     $service = new MultiFileService();
     try {
         $service->config(['fingerprint' => ['not a string'], 'path' => false, 'local_path' => true, 'pattern' => ['not a string']]);
         $this->fail('Expecting ServiceConfigurationException');
     } catch (ServiceConfigurationException $e) {
         $errors = $e->getErrors();
         foreach (['fingerprint', 'path', 'local_path', 'pattern'] as $key) {
             $this->assertArrayHasKey($key, $errors, 'Missing validation error for: ' . $key);
         }
     }
 }