| @@ 242-251 (lines=10) @@ | ||
| 239 | * |
|
| 240 | * @return void |
|
| 241 | */ |
|
| 242 | public function seeRemoteFile($filename) |
|
| 243 | { |
|
| 244 | $sftp = ssh2_sftp($this->connection); |
|
| 245 | try { |
|
| 246 | $res = ssh2_sftp_stat($sftp, $filename); |
|
| 247 | } catch (Exception $e) { |
|
| 248 | $res = null; |
|
| 249 | } |
|
| 250 | \PHPUnit_Framework_Assert::assertNotEmpty($res); |
|
| 251 | } |
|
| 252 | ||
| 253 | /** |
|
| 254 | * Verify that a file does not exist in the current remote folder |
|
| @@ 260-269 (lines=10) @@ | ||
| 257 | * |
|
| 258 | * @return void |
|
| 259 | */ |
|
| 260 | public function dontSeeRemoteFile($filename) |
|
| 261 | { |
|
| 262 | $sftp = ssh2_sftp($this->connection); |
|
| 263 | try { |
|
| 264 | $res = (bool) ssh2_sftp_stat($sftp, $filename); |
|
| 265 | } catch (Exception $e) { |
|
| 266 | $res = false; |
|
| 267 | } |
|
| 268 | \PHPUnit_Framework_Assert::assertFalse($res); |
|
| 269 | } |
|
| 270 | ||
| 271 | /** |
|
| 272 | * Get the content of a remote file over SFTP |
|