I'm working with phpseclib (https://github.com/phpseclib/phpseclib) and I come across a problem that I don't know how to solve.
So basically I would like to use PHP to connect to the same server that the script is running on via SSH to perform some SFTP transaction.
I tried ssh localhost
on command line and it logs me in using my SSH key-pair.
I implemented phpseclib to download/upload files from/to a remote server. Now I am writing unit tests for the code I've written. However, I cannot mock SFTP class since the object needs to be initiated for every connection, is there a way to test the function that I've written, basically just a file download and process data function.