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

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/opt/cpanel/ea-php74/root/usr/share/tests/pear/XML_Util/tests/   drwxr-xr-x
Free 235.86 GB of 981.82 GB (24.02%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

class AttributesToStringTests extends AbstractUnitTests
{
    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringBasicUsage()
    {
        
$original = array('foo' => 'bar','boo' => 'baz',);
        
$expected " boo=\"baz\" foo=\"bar\"";
        
$this->assertEquals($expectedXML_Util::attributesToString($original));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithExplicitSortTrue()
    {
        
$original = array('foo' => 'bar','boo' => 'baz',);
        
$expected " boo=\"baz\" foo=\"bar\"";
        
$sort true;
        
$this->assertEquals($expectedXML_Util::attributesToString($original$sort));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithExplicitSortFalse()
    {
        
$original = array('foo' => 'bar','boo' => 'baz',);
        
$expected " foo=\"bar\" boo=\"baz\"";
        
$sort false;
        
$this->assertEquals($expectedXML_Util::attributesToString($original$sort));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithMultilineFalse()
    {
        
$original = array('foo' => 'bar','boo' => 'baz',);
        
$expected " boo=\"baz\" foo=\"bar\"";
        
$sort true;
        
$multiline false;
        
$this->assertEquals($expectedXML_Util::attributesToString($original$sort$multiline));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithMultilineTrue()
    {
        
$original = array('foo' => 'bar','boo' => 'baz',);
        
$expected =
<<< EOF
 boo="baz"
    foo="bar"
EOF;
        
$sort true;
        
$multiline true;
        
$this->assertEquals($expectedXML_Util::attributesToString($original$sort$multiline));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithExplicitIndent()
    {
        
$original = array('foo' => 'bar','boo' => 'baz',);
        
$expected " boo=\"baz\"\n        foo=\"bar\"";
        
$sort true;
        
$multiline true;
        
$indent '        '// 8 spaces
        
$this->assertEquals($expectedXML_Util::attributesToString($original$sort$multiline$indent));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithExplicitLinebreak()
    {
        
$original = array('foo' => 'bar','boo' => 'baz',);
        
$expected " boo=\"baz\"\n^foo=\"bar\"";
        
$sort true;
        
$multiline true;
        
$linebreak '^'// some dummy character
        
$this->assertEquals($expectedXML_Util::attributesToString($original$sort$multiline$linebreak));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithOptionsThatIncludesSort()
    {
        
$original = array('foo' => 'bar','boo' => 'baz',);
        
$options = array(
            
'multiline' => true,
            
'indent'    => '----',
            
'linebreak' => "^",
            
'entities'  => XML_UTIL_ENTITIES_XML,
            
'sort'      => true,
        );

        
$expected " boo=\"baz\"\n----foo=\"bar\"";
        
$this->assertEquals($expectedXML_Util::attributesToString($original$options));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithOptionsThatExcludesSort()
    {
        
$original = array('foo' => 'bar','boo' => 'baz',);
        
$options = array(
            
'multiline' => true,
            
'indent'    => '----',
            
'linebreak' => "^",
            
'entities'  => XML_UTIL_ENTITIES_XML,
        );

        
$expected " boo=\"baz\"\n----foo=\"bar\"";
        
$this->assertEquals($expectedXML_Util::attributesToString($original$options));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithEntitiesNone()
    {
        
$original = array("foo" => "b@&r""boo" => "b><z");
        
$expected " boo=\"b><z\" foo=\"b@&r\"";
        
$sort true;
        
$multiline false;
        
$linebreak '    ';
        
$this->assertEquals($expectedXML_Util::attributesToString($original$sort$multiline$linebreakPHP_EOLXML_UTIL_ENTITIES_NONE));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithEntitiesXml()
    {
        
$original = array("foo" => "b@&r""boo" => "b><z");
        
$expected " boo=\"b&gt;&lt;z\" foo=\"b@&amp;r\"";
        
$sort true;
        
$multiline false;
        
$linebreak '    ';
        
$this->assertEquals($expectedXML_Util::attributesToString($original$sort$multiline$linebreakPHP_EOLXML_UTIL_ENTITIES_XML));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithEntitiesXmlRequired()
    {
        
$original = array("foo" => "b@&r""boo" => "b><z");
        
$expected " boo=\"b>&lt;z\" foo=\"b@&amp;r\"";
        
$sort true;
        
$multiline false;
        
$linebreak '    ';
        
$this->assertEquals($expectedXML_Util::attributesToString($original$sort$multiline$linebreakPHP_EOLXML_UTIL_ENTITIES_XML_REQUIRED));
    }

    
/**
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithEntitiesHtml()
    {
        
$original = array("foo" => "b@&r""boo" => "b><z");
        
$expected " boo=\"b&gt;&lt;z\" foo=\"b@&amp;r\"";
        
$sort true;
        
$multiline false;
        
$linebreak '    ';
        
$this->assertEquals($expectedXML_Util::attributesToString($original$sort$multiline$linebreakPHP_EOLXML_UTIL_ENTITIES_HTML));
    }

    
/**
     * Tag attributes should not be treated as CDATA,
     * so the operation will instead quietly use XML_UTIL_ENTITIES_XML.
     *
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithCDataSectionForSingleAttribute()
    {
        
$original = array('foo' => 'bar'); // need exactly one attribute here
        
$options = array(
            
'sort'      => true,   // doesn't matter for this testcase
            
'multiline' => false,  // doesn't matter for this testcase
            
'indent'    => null,   // doesn't matter for this testcase
            
'linebreak' => null,   // doesn't matter for this testcase
            
'entities'  => XML_UTIL_CDATA_SECTION// DOES matter for this testcase
        
);
        
$expected " foo=\"bar\"";
        
$this->assertEquals($expectedXML_Util::attributesToString($original$options));
    }

    
/**
     * Tag attributes should not be treated as CDATA,
     * so the operation will instead quietly use XML_UTIL_ENTITIES_XML.
     *
     * @covers XML_Util::attributesToString()
     */
    
public function testAttributesToStringWithCDataSectionForMultipleAttributesAndMultilineFalse()
    {
        
$original = array('foo' => 'bar''boo' => 'baz'); // need more than one attribute here
        
$options = array(
            
'sort'      => true,   // doesn't matter for this testcase
            
'multiline' => false,  // DOES matter for this testcase, must be false
            
'indent'    => null,   // doesn't matter for this testcase
            
'linebreak' => null,   // doesn't matter for this testcase
            
'entities'  => XML_UTIL_CDATA_SECTION// DOES matter for this testcase
        
);
        
$expected " boo=\"baz\" foo=\"bar\"";
        
$this->assertEquals($expectedXML_Util::attributesToString($original$options));
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

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