!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/dnoegel/php-xdg-base-dir/tests/   drwxr-xr-x
Free 116.92 GB of 200.55 GB (58.3%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

class XdgTest extends PHPUnit_Framework_TestCase
{
    
/**
     * @return \XdgBaseDir\Xdg
     */
    
public function getXdg()
    {
        return new \
XdgBaseDir\Xdg();
    }

    public function 
testGetHomeDir()
    {
         
putenv('HOME=/fake-dir');
         
$this->assertEquals('/fake-dir'$this->getXdg()->getHomeDir());
    }

    public function 
testGetFallbackHomeDir()
    {
        
putenv('HOME=');
        
putenv('HOMEDRIVE=C:');
        
putenv('HOMEPATH=fake-dir');
        
$this->assertEquals('C:/fake-dir'$this->getXdg()->getHomeDir());
    }

    public function 
testXdgPutCache()
    {
        
putenv('XDG_DATA_HOME=tmp/');
        
putenv('XDG_CONFIG_HOME=tmp/');
        
putenv('XDG_CACHE_HOME=tmp/');
        
$this->assertEquals('tmp/'$this->getXdg()->getHomeCacheDir());
    }

    public function 
testXdgPutData()
    {
        
putenv('XDG_DATA_HOME=tmp/');
        
$this->assertEquals('tmp/'$this->getXdg()->getHomeDataDir());
    }

    public function 
testXdgPutConfig()
    {
        
putenv('XDG_CONFIG_HOME=tmp/');
        
$this->assertEquals('tmp/'$this->getXdg()->getHomeConfigDir());
    }

    public function 
testXdgDataDirsShouldIncludeHomeDataDir()
    {
        
putenv('XDG_DATA_HOME=tmp/');
        
putenv('XDG_CONFIG_HOME=tmp/');

        
$this->assertArrayHasKey('tmp/'array_flip($this->getXdg()->getDataDirs()));
    }

    public function 
testXdgConfigDirsShouldIncludeHomeConfigDir()
    {
        
putenv('XDG_CONFIG_HOME=tmp/');

        
$this->assertArrayHasKey('tmp/'array_flip($this->getXdg()->getConfigDirs()));
    }

    
/**
     * If XDG_RUNTIME_DIR is set, it should be returned
     */
    
public function testGetRuntimeDir()
    {
        
putenv('XDG_RUNTIME_DIR=/tmp/');
        
$runtimeDir $this->getXdg()->getRuntimeDir();

        
$this->assertEquals(is_dir($runtimeDir), true);
    }

    
/**
     * In strict mode, an exception should be shown if XDG_RUNTIME_DIR does not exist
     *
     * @expectedException \RuntimeException
     */
    
public function testGetRuntimeDirShouldThrowException()
    {
        
putenv('XDG_RUNTIME_DIR=');
        
$this->getXdg()->getRuntimeDir(true);
    }

    
/**
     * In fallback mode a directory should be created
     */
    
public function testGetRuntimeDirShouldCreateDirectory()
    {
        
putenv('XDG_RUNTIME_DIR=');
        
$dir $this->getXdg()->getRuntimeDir(false);
        
$permission decoct(fileperms($dir) & 0777);
        
$this->assertEquals(700$permission);
    }

    
/**
     * Ensure, that the fallback directories are created with correct permission
     */
    
public function testGetRuntimeShouldDeleteDirsWithWrongPermission()
    {
        
$runtimeDir sys_get_temp_dir() . DIRECTORY_SEPARATOR XdgBaseDir\Xdg::RUNTIME_DIR_FALLBACK getenv('USER');

        
rmdir($runtimeDir);
        
mkdir($runtimeDir0764true);

        
// Permission should be wrong now
        
$permission decoct(fileperms($runtimeDir) & 0777);
        
$this->assertEquals(764$permission);

        
putenv('XDG_RUNTIME_DIR=');
        
$dir $this->getXdg()->getRuntimeDir(false);

        
// Permission should be fixed
        
$permission decoct(fileperms($dir) & 0777);
        
$this->assertEquals(700$permission);
    }
}

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