2014-06-26 22:21:55 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @author Andreas Fischer <bantu@phpbb.com>
|
2014-12-09 23:02:44 +00:00
|
|
|
* @copyright 2014 Andreas Fischer
|
2014-06-26 22:21:55 +00:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
|
|
|
*/
|
|
|
|
|
|
|
|
require_once 'Net/SFTP/Stream.php';
|
|
|
|
|
2020-12-12 21:11:04 +00:00
|
|
|
class Unit_Net_SFTPStreamUnitTest extends PhpseclibTestCase
|
2014-06-26 22:21:55 +00:00
|
|
|
{
|
|
|
|
protected $protocol = 'sftptest';
|
|
|
|
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
if (in_array($this->protocol, stream_get_wrappers())) {
|
|
|
|
stream_wrapper_unregister($this->protocol);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testRegisterFromSideEffect()
|
|
|
|
{
|
|
|
|
// Including the file registers 'sftp' as a stream.
|
|
|
|
$this->assertContains('sftp', stream_get_wrappers());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testRegisterWithArgument()
|
|
|
|
{
|
|
|
|
Net_SFTP_Stream::register($this->protocol);
|
|
|
|
$this->assertContains($this->protocol, stream_get_wrappers());
|
|
|
|
}
|
|
|
|
}
|