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
|
|
|
|
*/
|
|
|
|
|
2014-12-10 01:31:41 +00:00
|
|
|
use phpseclib\Net\SFTP\Stream;
|
|
|
|
|
2014-06-26 22:21:55 +00:00
|
|
|
class Unit_Net_SFTPStreamTest extends PhpseclibTestCase
|
|
|
|
{
|
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
|
|
|
}
|
|
|
|
}
|