2014-06-27 00:21:55 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @author Andreas Fischer <bantu@phpbb.com>
|
2014-12-10 00:02:44 +01:00
|
|
|
* @copyright 2014 Andreas Fischer
|
2014-06-27 00:21:55 +02:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
|
|
|
*/
|
|
|
|
|
2014-12-10 02:31:41 +01:00
|
|
|
use phpseclib\Net\SFTP\Stream;
|
|
|
|
|
2014-06-27 00:21:55 +02:00
|
|
|
class Unit_Net_SFTPStreamTest extends PhpseclibTestCase
|
|
|
|
{
|
2014-06-27 14:22:47 +02:00
|
|
|
public function testRegisterWithoutArgument()
|
2014-06-27 00:21:55 +02:00
|
|
|
{
|
2014-12-10 02:31:41 +01:00
|
|
|
$this->assertTrue(Stream::register());
|
2014-06-27 00:21:55 +02:00
|
|
|
$this->assertContains('sftp', stream_get_wrappers());
|
2014-06-27 14:22:47 +02:00
|
|
|
$this->assertTrue(stream_wrapper_unregister('sftp'));
|
2014-06-27 00:21:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testRegisterWithArgument()
|
|
|
|
{
|
2014-06-27 14:22:47 +02:00
|
|
|
$protocol = 'sftptest';
|
2014-12-10 02:31:41 +01:00
|
|
|
$this->assertTrue(Stream::register($protocol));
|
2014-06-27 14:22:47 +02:00
|
|
|
$this->assertContains($protocol, stream_get_wrappers());
|
|
|
|
$this->assertTrue(stream_wrapper_unregister($protocol));
|
2014-06-27 00:21:55 +02:00
|
|
|
}
|
|
|
|
}
|