!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_led/php/vendor/guzzlehttp/streams/tests/   drwxrwxr-x
Free 11.6 GB of 61.93 GB (18.73%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     StreamDecoratorTraitTest.php (3.82 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace GuzzleHttp\Tests\Stream;

use 
GuzzleHttp\Stream\StreamInterface;
use 
GuzzleHttp\Stream\Stream;
use 
GuzzleHttp\Stream\StreamDecoratorTrait;

class 
Str implements StreamInterface
{
    use 
StreamDecoratorTrait;
}

/**
 * @covers GuzzleHttp\Stream\StreamDecoratorTrait
 */
class StreamDecoratorTraitTest extends \PHPUnit_Framework_TestCase
{
    private 
$a;
    private 
$b;
    private 
$c;

    public function 
setUp()
    {
        
$this->fopen('php://temp''r+');
        
fwrite($this->c'foo');
        
fseek($this->c0);
        
$this->Stream::factory($this->c);
        
$this->= new Str($this->a);
    }

    public function 
testCatchesExceptionsWhenCastingToString()
    {
        
$s $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
            ->
setMethods(['read'])
            ->
getMockForAbstractClass();
        
$s->expects($this->once())
            ->
method('read')
            ->
will($this->throwException(new \Exception('foo')));
        
$msg '';
        
set_error_handler(function ($errNo$str) use (&$msg) { $msg $str; });
        echo new 
Str($s);
        
restore_error_handler();
        
$this->assertContains('foo'$msg);
    }

    public function 
testToString()
    {
        
$this->assertEquals('foo', (string) $this->b);
    }

    public function 
testHasSize()
    {
        
$this->assertEquals(3$this->b->getSize());
        
$this->assertSame($this->b$this->b->setSize(2));
        
$this->assertEquals(2$this->b->getSize());
    }

    public function 
testReads()
    {
        
$this->assertEquals('foo'$this->b->read(10));
    }

    public function 
testCheckMethods()
    {
        
$this->assertEquals($this->a->isReadable(), $this->b->isReadable());
        
$this->assertEquals($this->a->isWritable(), $this->b->isWritable());
        
$this->assertEquals($this->a->isSeekable(), $this->b->isSeekable());
    }

    public function 
testSeeksAndTells()
    {
        
$this->assertTrue($this->b->seek(1));
        
$this->assertEquals(1$this->a->tell());
        
$this->assertEquals(1$this->b->tell());
        
$this->assertTrue($this->b->seek(0));
        
$this->assertEquals(0$this->a->tell());
        
$this->assertEquals(0$this->b->tell());
        
$this->assertTrue($this->b->seek(0SEEK_END));
        
$this->assertEquals(3$this->a->tell());
        
$this->assertEquals(3$this->b->tell());
    }

    public function 
testGetsContents()
    {
        
$this->assertEquals('foo'$this->b->getContents());
        
$this->assertEquals(''$this->b->getContents());
        
$this->b->seek(1);
        
$this->assertEquals('oo'$this->b->getContents(1));
    }

    public function 
testCloses()
    {
        
$this->b->close();
        
$this->assertFalse(is_resource($this->c));
    }

    public function 
testDetaches()
    {
        
$this->b->detach();
        
$this->assertFalse($this->b->isReadable());
    }

    
/**
     * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException
     */
    
public function testCannotAttachByDefault()
    {
        
$this->b->attach('a');
    }

    public function 
testWrapsMetadata()
    {
        
$this->assertSame($this->b->getMetadata(), $this->a->getMetadata());
        
$this->assertSame($this->b->getMetadata('uri'), $this->a->getMetadata('uri'));
    }

    public function 
testWrapsWrites()
    {
        
$this->b->seek(0SEEK_END);
        
$this->b->write('foo');
        
$this->assertEquals('foofoo', (string) $this->a);
    }

    
/**
     * @expectedException \UnexpectedValueException
     */
    
public function testThrowsWithInvalidGetter()
    {
        
$this->b->foo;
    }

    
/**
     * @expectedException \BadMethodCallException
     */
    
public function testThrowsWhenGetterNotImplemented()
    {
        
$s = new BadStream();
        
$s->stream;
    }
}

class 
BadStream
{
    use 
StreamDecoratorTrait;

    public function 
__construct() {}
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.5841 ]--