2014-06-26 22:21:55 +00:00
|
|
|
<?php
|
2022-02-17 02:25:59 +00:00
|
|
|
|
2014-06-26 22:21:55 +00:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
|
2022-02-23 02:48:51 +00:00
|
|
|
namespace phpseclib3\Tests\Unit\Net;
|
|
|
|
|
2019-11-07 05:41:40 +00:00
|
|
|
use phpseclib3\Net\SFTP\Stream;
|
2022-02-23 02:48:51 +00:00
|
|
|
use phpseclib3\Tests\PhpseclibTestCase;
|
2014-12-10 01:31:41 +00:00
|
|
|
|
2022-02-23 02:48:51 +00:00
|
|
|
class SFTPStreamUnitTest extends PhpseclibTestCase
|
2014-06-26 22:21:55 +00:00
|
|
|
{
|
2014-06-27 12:22:47 +00:00
|
|
|
public function testRegisterWithoutArgument()
|
2014-06-26 22:21:55 +00:00
|
|
|
{
|
2014-12-10 01:31:41 +00:00
|
|
|
$this->assertTrue(Stream::register());
|
2014-06-26 22:21:55 +00:00
|
|
|
$this->assertContains('sftp', stream_get_wrappers());
|
2014-06-27 12:22:47 +00:00
|
|
|
$this->assertTrue(stream_wrapper_unregister('sftp'));
|
2014-06-26 22:21:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testRegisterWithArgument()
|
|
|
|
{
|
2014-06-27 12:22:47 +00:00
|
|
|
$protocol = 'sftptest';
|
2014-12-10 01:31:41 +00:00
|
|
|
$this->assertTrue(Stream::register($protocol));
|
2014-06-27 12:22:47 +00:00
|
|
|
$this->assertContains($protocol, stream_get_wrappers());
|
|
|
|
$this->assertTrue(stream_wrapper_unregister($protocol));
|
2014-06-26 22:21:55 +00:00
|
|
|
}
|
|
|
|
}
|