!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/Unserializer/   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:     XMLTest.php (4.59 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace PhpParser\Unserializer;

use 
PhpParser\Node\Scalar;
use 
PhpParser\Comment;

class 
XMLTest extends \PHPUnit_Framework_TestCase
{
    public function 
testNode() {
        
$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<AST xmlns:node="http://nikic.github.com/PHPParser/XML/node" xmlns:subNode="http://nikic.github.com/PHPParser/XML/subNode" xmlns:attribute="http://nikic.github.com/PHPParser/XML/attribute" xmlns:scalar="http://nikic.github.com/PHPParser/XML/scalar">
 <node:Scalar_String line="1" docComment="/** doc comment */">
  <attribute:startLine>
   <scalar:int>1</scalar:int>
  </attribute:startLine>
  <attribute:comments>
   <scalar:array>
    <comment isDocComment="false" line="2">// comment
</comment>
    <comment isDocComment="true" line="3">/** doc comment */</comment>
   </scalar:array>
  </attribute:comments>
  <subNode:value>
   <scalar:string>Test</scalar:string>
  </subNode:value>
 </node:Scalar_String>
</AST>
XML;

        
$unserializer  = new XML;
        
$this->assertEquals(
            new 
Scalar\String_('Test', array(
                
'startLine' => 1,
                
'comments'  => array(
                    new 
Comment('// comment' "\n"2),
                    new 
Comment\Doc('/** doc comment */'3),
                ),
            )),
            
$unserializer->unserialize($xml)
        );
    }

    public function 
testEmptyNode() {
        
$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<AST xmlns:node="http://nikic.github.com/PHPParser/XML/node">
 <node:Scalar_MagicConst_Class />
</AST>
XML;

        
$unserializer  = new XML;

        
$this->assertEquals(
            new 
Scalar\MagicConst\Class_,
            
$unserializer->unserialize($xml)
        );
    }

    public function 
testScalars() {
        
$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<AST xmlns:scalar="http://nikic.github.com/PHPParser/XML/scalar">
 <scalar:array>
  <scalar:array></scalar:array>
  <scalar:array/>
  <scalar:string>test</scalar:string>
  <scalar:string></scalar:string>
  <scalar:string/>
  <scalar:int>1</scalar:int>
  <scalar:float>1</scalar:float>
  <scalar:float>1.5</scalar:float>
  <scalar:true/>
  <scalar:false/>
  <scalar:null/>
 </scalar:array>
</AST>
XML;
        
$result = array(
            array(), array(),
            
'test''''',
            
1,
            
11.5,
            
truefalsenull
        
);

        
$unserializer  = new XML;
        
$this->assertEquals($result$unserializer->unserialize($xml));
    }

    
/**
     * @expectedException        \DomainException
     * @expectedExceptionMessage AST root element not found
     */
    
public function testWrongRootElementError() {
        
$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<notAST/>
XML;

        
$unserializer = new XML;
        
$unserializer->unserialize($xml);
    }

    
/**
     * @dataProvider             provideTestErrors
     */
    
public function testErrors($xml$errorMsg) {
        
$this->setExpectedException('DomainException'$errorMsg);

        
$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<AST xmlns:scalar="http://nikic.github.com/PHPParser/XML/scalar"
     xmlns:node="http://nikic.github.com/PHPParser/XML/node"
     xmlns:subNode="http://nikic.github.com/PHPParser/XML/subNode"
     xmlns:foo="http://nikic.github.com/PHPParser/XML/foo">
 
$xml
</AST>
XML;

        
$unserializer = new XML;
        
$unserializer->unserialize($xml);
    }

    public function 
provideTestErrors() {
        return array(
            array(
'<scalar:true>test</scalar:true>',   '"true" scalar must be empty'),
            array(
'<scalar:false>test</scalar:false>''"false" scalar must be empty'),
            array(
'<scalar:null>test</scalar:null>',   '"null" scalar must be empty'),
            array(
'<scalar:foo>bar</scalar:foo>',      'Unknown scalar type "foo"'),
            array(
'<scalar:int>x</scalar:int>',        '"x" is not a valid int'),
            array(
'<scalar:float>x</scalar:float>',    '"x" is not a valid float'),
            array(
'',                                  'Expected node or scalar'),
            array(
'<foo:bar>test</foo:bar>',           'Unexpected node of type "foo:bar"'),
            array(
                
'<node:Scalar_String><foo:bar>test</foo:bar></node:Scalar_String>',
                
'Expected sub node or attribute, got node of type "foo:bar"'
            
),
            array(
                
'<node:Scalar_String><subNode:value/></node:Scalar_String>',
                
'Expected node or scalar'
            
),
            array(
                
'<node:Foo><subNode:value/></node:Foo>',
                
'Unknown node type "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.012 ]--