phpseclib/tests/Unit/Net/SFTPStreamUnitTest.php

33 lines
893 B
PHP
Raw Normal View History

<?php
2022-02-17 02:25:59 +00:00
/**
* @author Andreas Fischer <bantu@phpbb.com>
* @copyright 2014 Andreas Fischer
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
2022-06-04 15:31:21 +00:00
declare(strict_types=1);
namespace phpseclib3\Tests\Unit\Net;
use phpseclib3\Net\SFTP\Stream;
use phpseclib3\Tests\PhpseclibTestCase;
2014-12-10 01:31:41 +00:00
class SFTPStreamUnitTest extends PhpseclibTestCase
{
2022-06-04 15:31:21 +00:00
public function testRegisterWithoutArgument(): void
{
2014-12-10 01:31:41 +00:00
$this->assertTrue(Stream::register());
$this->assertContains('sftp', stream_get_wrappers());
$this->assertTrue(stream_wrapper_unregister('sftp'));
}
2022-06-04 15:31:21 +00:00
public function testRegisterWithArgument(): void
{
$protocol = 'sftptest';
2014-12-10 01:31:41 +00:00
$this->assertTrue(Stream::register($protocol));
$this->assertContains($protocol, stream_get_wrappers());
$this->assertTrue(stream_wrapper_unregister($protocol));
}
}