Пример #1
0
 /**
  * testReturnObjectIsInstanceOf method
  *
  * @return void
  */
 public function testReturnObjectIsInstanceOf()
 {
     $this->assertInstanceOf('\\NetDeviceLib\\Auth\\Credentials', AuthFactory::credentials());
     $this->assertInstanceOf('\\NetDeviceLib\\Auth\\Credentials', AuthFactory::credentials('Credentials'));
     $this->assertInstanceOf('\\NetDeviceLib\\Auth\\SshPublicKeyCredentials', AuthFactory::credentials('SshPublicKeyCredentials'));
     $this->assertInstanceOf('\\NetDeviceLib\\Auth\\SnmpCredentials', AuthFactory::credentials('SnmpCredentials'));
     $this->assertInstanceOf('\\NetDeviceLib\\Auth\\SnmpV3Credentials', AuthFactory::credentials('SnmpV3Credentials'));
 }
Пример #2
0
 public function __construct($config = [])
 {
     $this->config($config);
     if ($this->config('ssh.authType') == 'password') {
         $this->_credentials = AuthFactory::credentials('Credentials', $this->config('ssh.credentials'));
     } elseif ($this->config('ssh.authType') == 'publicKey') {
         $this->_credentials = AuthFactory::credentials('SshPublicKeyCredentials', $this->config('ssh.credentials'));
     } else {
         throw new \Exception("Invalid authType '" . $this->config('ssh.authType') . "' specified");
     }
 }
Пример #3
0
 public function __construct($config = [])
 {
     $this->config($config);
     $this->_credentials = AuthFactory::credentials('Credentials', $this->config('credentials'));
     //$this->_socket = new Socket($this->config('socket'));
 }