mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-09-29 07:39:00 +00:00
Add unit test for (to be added) Net_SFTP_Stream::register().
This commit is contained in:
parent
949cfcc867
commit
f360932343
33
tests/Unit/Net/SFTPStreamTest.php
Normal file
33
tests/Unit/Net/SFTPStreamTest.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Andreas Fischer <bantu@phpbb.com>
|
||||
* @copyright MMXIV Andreas Fischer
|
||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||
*/
|
||||
|
||||
require_once 'Net/SFTP/Stream.php';
|
||||
|
||||
class Unit_Net_SFTPStreamTest extends PhpseclibTestCase
|
||||
{
|
||||
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());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user