!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/Builder/   drwxr-xr-x
Free 116.59 GB of 200.55 GB (58.14%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

namespace PhpParser\Builder;

use 
PhpParser\Node;
use 
PhpParser\Node\Expr\Print_;
use 
PhpParser\Node\Scalar\String_;
use 
PhpParser\Node\Stmt;
use 
PhpParser\Comment;

class 
MethodTest extends \PHPUnit_Framework_TestCase
{
    public function 
createMethodBuilder($name) {
        return new 
Method($name);
    }

    public function 
testModifiers() {
        
$node $this->createMethodBuilder('test')
            ->
makePublic()
            ->
makeAbstract()
            ->
makeStatic()
            ->
getNode()
        ;

        
$this->assertEquals(
            new 
Stmt\ClassMethod('test', array(
                
'type' => Stmt\Class_::MODIFIER_PUBLIC
                        
Stmt\Class_::MODIFIER_ABSTRACT
                        
Stmt\Class_::MODIFIER_STATIC,
                
'stmts' => null,
            )),
            
$node
        
);

        
$node $this->createMethodBuilder('test')
            ->
makeProtected()
            ->
makeFinal()
            ->
getNode()
        ;

        
$this->assertEquals(
            new 
Stmt\ClassMethod('test', array(
                
'type' => Stmt\Class_::MODIFIER_PROTECTED
                        
Stmt\Class_::MODIFIER_FINAL
            
)),
            
$node
        
);

        
$node $this->createMethodBuilder('test')
            ->
makePrivate()
            ->
getNode()
        ;

        
$this->assertEquals(
            new 
Stmt\ClassMethod('test', array(
                
'type' => Stmt\Class_::MODIFIER_PRIVATE
            
)),
            
$node
        
);
    }

    public function 
testReturnByRef() {
        
$node $this->createMethodBuilder('test')
            ->
makeReturnByRef()
            ->
getNode()
        ;

        
$this->assertEquals(
            new 
Stmt\ClassMethod('test', array(
                
'byRef' => true
            
)),
            
$node
        
);
    }

    public function 
testParams() {
        
$param1 = new Node\Param('test1');
        
$param2 = new Node\Param('test2');
        
$param3 = new Node\Param('test3');

        
$node $this->createMethodBuilder('test')
            ->
addParam($param1)
            ->
addParams(array($param2$param3))
            ->
getNode()
        ;

        
$this->assertEquals(
            new 
Stmt\ClassMethod('test', array(
                
'params' => array($param1$param2$param3)
            )),
            
$node
        
);
    }

    public function 
testStmts() {
        
$stmt1 = new Print_(new String_('test1'));
        
$stmt2 = new Print_(new String_('test2'));
        
$stmt3 = new Print_(new String_('test3'));

        
$node $this->createMethodBuilder('test')
            ->
addStmt($stmt1)
            ->
addStmts(array($stmt2$stmt3))
            ->
getNode()
        ;

        
$this->assertEquals(
            new 
Stmt\ClassMethod('test', array(
                
'stmts' => array($stmt1$stmt2$stmt3)
            )),
            
$node
        
);
    }
    public function 
testDocComment() {
        
$node $this->createMethodBuilder('test')
            ->
setDocComment('/** Test */')
            ->
getNode();

        
$this->assertEquals(new Stmt\ClassMethod('test', array(), array(
            
'comments' => array(new Comment\Doc('/** Test */'))
        )), 
$node);
    }

    public function 
testReturnType() {
        
$node $this->createMethodBuilder('test')
            ->
setReturnType('bool')
            ->
getNode();
        
$this->assertEquals(new Stmt\ClassMethod('test', array(
            
'returnType' => 'bool'
        
), array()), $node);
    }

    
/**
     * @expectedException \LogicException
     * @expectedExceptionMessage Cannot add statements to an abstract method
     */
    
public function testAddStmtToAbstractMethodError() {
        
$this->createMethodBuilder('test')
            ->
makeAbstract()
            ->
addStmt(new Print_(new String_('test')))
        ;
    }

    
/**
     * @expectedException \LogicException
     * @expectedExceptionMessage Cannot make method with statements abstract
     */
    
public function testMakeMethodWithStmtsAbstractError() {
        
$this->createMethodBuilder('test')
            ->
addStmt(new Print_(new String_('test')))
            ->
makeAbstract()
        ;
    }

    
/**
     * @expectedException \LogicException
     * @expectedExceptionMessage Expected parameter node, got "Name"
     */
    
public function testInvalidParamError() {
        
$this->createMethodBuilder('test')
            ->
addParam(new Node\Name('foo'))
        ;
    }
}

:: 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.0121 ]--