!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/local/lib/php/test/HTML_Template_IT/tests/   drwxr-xr-x
Free 318.31 GB of 458.09 GB (69.49%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

class IT_api_TestCase extends PHPUnit_TestCase
{
   
/**
    * An HTML_Template_IT object
    * @var object
    */
    
var $tpl;

    function 
IT_api_TestCase($name)
    {
        
$this->PHPUnit_TestCase($name);
    }

    function 
setUp()
    {
        
$this->tpl =& new HTML_Template_IT('./templates');
    }

    function 
tearDown()
    {
        unset(
$this->tpl);
    }

    function 
_stripWhitespace($str)
    {
        return 
preg_replace('/\\s+/'''$str);
    }

    function 
_methodExists($name
    {
        if (
in_array(strtolower($name), get_class_methods($this->tpl))) {
            return 
true;
        }
        
$this->assertTrue(false'method '$name ' not implemented in ' get_class($this->tpl));
        return 
false;
    }

   
/**
    * Tests a setTemplate method 
    *
    */
    
function testSetTemplate()
    {
        
$result $this->tpl->setTemplate('A template'falsefalse);
        if (
PEAR::isError($result)) {
            
$this->assertTrue(false'Error setting template: '$result->getMessage());
        }
        
$this->assertEquals('A template'$this->tpl->get());
    }

   
/**
    * Tests a loadTemplatefile method 
    *
    */
    
function testLoadTemplatefile()
    {
        
$result $this->tpl->loadTemplatefile('loadtemplatefile.html'falsefalse);
        if (
PEAR::isError($result)) {
            
$this->assertTrue(false'Error loading template file: '$result->getMessage());
        }
        
$this->assertEquals('A template'trim($this->tpl->get()));
    }

   
/**
    * Tests a setVariable method
    *
    */
    
function testSetVariable()
    {
        
$result $this->tpl->setTemplate('{placeholder1} {placeholder2} {placeholder3}'truetrue);
        if (
PEAR::isError($result)) {
            
$this->assertTrue(false'Error setting template: '$result->getMessage());
        }
        
// "scalar" call
        
$this->tpl->setVariable('placeholder1''var1');
        
// array call
        
$this->tpl->setVariable(array(
            
'placeholder2' => 'var2',
            
'placeholder3' => 'var3'
        
));
        
$this->assertEquals('var1 var2 var3'$this->tpl->get());
    }

   
/**
    * Tests the <!-- INCLUDE --> functionality 
    *
    */
    
function testInclude()
    {
        
$result $this->tpl->loadTemplateFile('include.html'falsefalse);
        if (
PEAR::isError($result)) {
            
$this->assertTrue(false'Error loading template file: '$result->getMessage());
        }
        
$this->assertEquals('Master file; Included file'trim($this->tpl->get()));
    }

   
/**
    *
    */
    
function testCurrentBlock()
    {
        
$result $this->tpl->loadTemplateFile('blockiteration.html'truetrue);
        if (
PEAR::isError($result)) {
            
$this->assertTrue(false'Error loading template file: '$result->getMessage());
        }
        
$this->tpl->setVariable('outer''a');
        
$this->tpl->setCurrentBlock('inner_block');
        for (
$i 0$i 5$i++) {
            
$this->tpl->setVariable('inner'$i 1);
            
$this->tpl->parseCurrentBlock();
        } 
// for
        
$this->assertEquals('a|1|2|3|4|5#'$this->_stripWhitespace($this->tpl->get()));
    }

   
/**
    *
    */
    
function testRemovePlaceholders()
    {
        
$result $this->tpl->setTemplate('{placeholder1},{placeholder2},{placeholder3}'truetrue);
        if (
PEAR::isError($result)) {
            
$this->assertTrue(false'Error setting template: '$result->getMessage());
        }
        
// we do not set {placeholder3}
        
$this->tpl->setVariable(array(
            
'placeholder1' => 'var1',
            
'placeholder2' => 'var2'
        
));
        
$this->assertEquals('var1,var2,'$this->tpl->get());

        
// Now, we should really add a switch for keeping {stuff} in
        // data supplied to setVariable() safe. Until then, removing it should
        // be expected behaviour
        
$result $this->tpl->setTemplate('{placeholder1},{placeholder2},{placeholder3}'truetrue);
        if (
PEAR::isError($result)) {
            
$this->assertTrue(false'Error setting template: '$result->getMessage());
        }
        
$this->tpl->setVariable(array(
            
'placeholder1' => 'var1',
            
'placeholder2' => 'var2',
            
'placeholder3' => 'var3{stuff}'
        
));
        
$this->assertEquals('var1,var2,var3'$this->tpl->get());
    }

   
/**
    *
    */
    
function testTouchBlock()
    {
        
$result $this->tpl->loadTemplateFile('blockiteration.html'falsetrue);
        if (
PEAR::isError($result)) {
            
$this->assertTrue(false'Error loading template file: '$result->getMessage());
        }
        
$this->tpl->setVariable('outer''data');
        
// inner_block should be preserved in output, even if empty
        
$this->tpl->touchBlock('inner_block');
        
$this->assertEquals('data|{inner}#'$this->_stripWhitespace($this->tpl->get()));
    }
   
    
// Not available in stock class

   /**
    *
    */
    /*
    function testHideBlock()
    {
        if (!$this->_methodExists('hideBlock')) {
            return;
        }
        $result = $this->tpl->loadTemplateFile('blockiteration.html', false, true);
        if (PEAR::isError($result)) {
            $this->assertTrue(false, 'Error loading template file: '. $result->getMessage());
        }
        $this->tpl->setVariable(array(
            'outer' => 'data',
            'inner' => 'stuff'
        ));
        // inner_block is not empty, but should be removed nonetheless
        $this->tpl->hideBlock('inner_block');
        $this->assertEquals('data#', $this->_stripWhitespace($this->tpl->get()));
    }
    */
   /**
    *
    */
    /*
    function testSetGlobalVariable()
    {
        if (!$this->_methodExists('setGlobalVariable')) {
            return;
        }
        $result = $this->tpl->loadTemplateFile('globals.html', false, true);
        if (PEAR::isError($result)) {
            $this->assertTrue(false, 'Error loading template file: '. $result->getMessage());
        }
        $this->tpl->setGlobalVariable('glob', 'glob');
        // {var2} is not, block_two should be removed
        $this->tpl->setVariable(array(
            'var1' => 'one',
            'var3' => 'three'
        ));
        for ($i = 0; $i < 3; $i++) {
            $this->tpl->setVariable('var4', $i + 1);
            $this->tpl->parse('block_four');
        } // for
        $this->assertEquals('glob:one#glob:three|glob:1|glob:2|glob:3#', $this->_stripWhitespace($this->tpl->get()));
    }
    */
}

?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0305 ]--