/** * @ * @throws \MOC\V\Core\SecureKernel\Component\Exception\ComponentException */ public function testSFTP() { $Bridge = new SFTP(); $Bridge->openConnection('host', 22); $Bridge->loginCredentialKey('user', __DIR__ . '/sftp-ssh2-rsa-4096-private.ppk', 'password'); $Bridge->changeDirectory('.'); $Bridge->closeConnection(); }
/** * @throws \MOC\V\Core\SecureKernel\Component\Exception\ComponentException */ public function testSFTP() { $Bridge = new SFTP(); $Bridge->openConnection('host', 22); try { $Bridge->loginCredentialKey('user', __FILE__, 'password'); } catch (\Exception $Exception) { $this->assertInstanceOf('\\MOC\\V\\Core\\SecureKernel\\Component\\Exception\\ComponentException', $Exception); } try { $Bridge->changeDirectory('.'); } catch (\Exception $Exception) { $this->assertInstanceOf('\\MOC\\V\\Core\\SecureKernel\\Component\\Exception\\ComponentException', $Exception); } $Bridge->closeConnection(); }