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


Viewing file:     PhpGeneratorDumperTest.php (7.35 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\Routing\Tests\Generator\Dumper;

use 
Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use 
Symfony\Component\Routing\RouteCollection;
use 
Symfony\Component\Routing\Route;
use 
Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper;
use 
Symfony\Component\Routing\RequestContext;

class 
PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
{
    
/**
     * @var RouteCollection
     */
    
private $routeCollection;

    
/**
     * @var PhpGeneratorDumper
     */
    
private $generatorDumper;

    
/**
     * @var string
     */
    
private $testTmpFilepath;

    
/**
     * @var string
     */
    
private $largeTestTmpFilepath;

    protected function 
setUp()
    {
        
parent::setUp();

        
$this->routeCollection = new RouteCollection();
        
$this->generatorDumper = new PhpGeneratorDumper($this->routeCollection);
        
$this->testTmpFilepath sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.'.$this->getName().'.php';
        
$this->largeTestTmpFilepath sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.'.$this->getName().'.large.php';
        @
unlink($this->testTmpFilepath);
        @
unlink($this->largeTestTmpFilepath);
    }

    protected function 
tearDown()
    {
        
parent::tearDown();

        @
unlink($this->testTmpFilepath);

        
$this->routeCollection null;
        
$this->generatorDumper null;
        
$this->testTmpFilepath null;
    }

    public function 
testDumpWithRoutes()
    {
        
$this->routeCollection->add('Test', new Route('/testing/{foo}'));
        
$this->routeCollection->add('Test2', new Route('/testing2'));

        
file_put_contents($this->testTmpFilepath$this->generatorDumper->dump());
        include 
$this->testTmpFilepath;

        
$projectUrlGenerator = new \ProjectUrlGenerator(new RequestContext('/app.php'));

        
$absoluteUrlWithParameter $projectUrlGenerator->generate('Test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_URL);
        
$absoluteUrlWithoutParameter $projectUrlGenerator->generate('Test2', array(), UrlGeneratorInterface::ABSOLUTE_URL);
        
$relativeUrlWithParameter $projectUrlGenerator->generate('Test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_PATH);
        
$relativeUrlWithoutParameter $projectUrlGenerator->generate('Test2', array(), UrlGeneratorInterface::ABSOLUTE_PATH);

        
$this->assertEquals($absoluteUrlWithParameter'http://localhost/app.php/testing/bar');
        
$this->assertEquals($absoluteUrlWithoutParameter'http://localhost/app.php/testing2');
        
$this->assertEquals($relativeUrlWithParameter'/app.php/testing/bar');
        
$this->assertEquals($relativeUrlWithoutParameter'/app.php/testing2');
    }

    public function 
testDumpWithTooManyRoutes()
    {
        if (
defined('HHVM_VERSION_ID')) {
            
$this->markTestSkipped('HHVM consumes too much memory on this test.');
        }

        
$this->routeCollection->add('Test', new Route('/testing/{foo}'));
        for (
$i 0$i 32769; ++$i) {
            
$this->routeCollection->add('route_'.$i, new Route('/route_'.$i));
        }
        
$this->routeCollection->add('Test2', new Route('/testing2'));

        
file_put_contents($this->largeTestTmpFilepath$this->generatorDumper->dump(array(
            
'class' => 'ProjectLargeUrlGenerator',
        )));
        
$this->routeCollection $this->generatorDumper null;
        include 
$this->largeTestTmpFilepath;

        
$projectUrlGenerator = new \ProjectLargeUrlGenerator(new RequestContext('/app.php'));

        
$absoluteUrlWithParameter $projectUrlGenerator->generate('Test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_URL);
        
$absoluteUrlWithoutParameter $projectUrlGenerator->generate('Test2', array(), UrlGeneratorInterface::ABSOLUTE_URL);
        
$relativeUrlWithParameter $projectUrlGenerator->generate('Test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_PATH);
        
$relativeUrlWithoutParameter $projectUrlGenerator->generate('Test2', array(), UrlGeneratorInterface::ABSOLUTE_PATH);

        
$this->assertEquals($absoluteUrlWithParameter'http://localhost/app.php/testing/bar');
        
$this->assertEquals($absoluteUrlWithoutParameter'http://localhost/app.php/testing2');
        
$this->assertEquals($relativeUrlWithParameter'/app.php/testing/bar');
        
$this->assertEquals($relativeUrlWithoutParameter'/app.php/testing2');
    }

    
/**
     * @expectedException \InvalidArgumentException
     */
    
public function testDumpWithoutRoutes()
    {
        
file_put_contents($this->testTmpFilepath$this->generatorDumper->dump(array('class' => 'WithoutRoutesUrlGenerator')));
        include 
$this->testTmpFilepath;

        
$projectUrlGenerator = new \WithoutRoutesUrlGenerator(new RequestContext('/app.php'));

        
$projectUrlGenerator->generate('Test', array());
    }

    
/**
     * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException
     */
    
public function testGenerateNonExistingRoute()
    {
        
$this->routeCollection->add('Test', new Route('/test'));

        
file_put_contents($this->testTmpFilepath$this->generatorDumper->dump(array('class' => 'NonExistingRoutesUrlGenerator')));
        include 
$this->testTmpFilepath;

        
$projectUrlGenerator = new \NonExistingRoutesUrlGenerator(new RequestContext());
        
$url $projectUrlGenerator->generate('NonExisting', array());
    }

    public function 
testDumpForRouteWithDefaults()
    {
        
$this->routeCollection->add('Test', new Route('/testing/{foo}', array('foo' => 'bar')));

        
file_put_contents($this->testTmpFilepath$this->generatorDumper->dump(array('class' => 'DefaultRoutesUrlGenerator')));
        include 
$this->testTmpFilepath;

        
$projectUrlGenerator = new \DefaultRoutesUrlGenerator(new RequestContext());
        
$url $projectUrlGenerator->generate('Test', array());

        
$this->assertEquals($url'/testing');
    }

    public function 
testDumpWithSchemeRequirement()
    {
        
$this->routeCollection->add('Test1', new Route('/testing', array(), array(), array(), '', array('ftp''https')));

        
file_put_contents($this->testTmpFilepath$this->generatorDumper->dump(array('class' => 'SchemeUrlGenerator')));
        include 
$this->testTmpFilepath;

        
$projectUrlGenerator = new \SchemeUrlGenerator(new RequestContext('/app.php'));

        
$absoluteUrl $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_URL);
        
$relativeUrl $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_PATH);

        
$this->assertEquals($absoluteUrl'ftp://localhost/app.php/testing');
        
$this->assertEquals($relativeUrl'ftp://localhost/app.php/testing');

        
$projectUrlGenerator = new \SchemeUrlGenerator(new RequestContext('/app.php''GET''localhost''https'));

        
$absoluteUrl $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_URL);
        
$relativeUrl $projectUrlGenerator->generate('Test1', array(), UrlGeneratorInterface::ABSOLUTE_PATH);

        
$this->assertEquals($absoluteUrl'https://localhost/app.php/testing');
        
$this->assertEquals($relativeUrl'/app.php/testing');
    }
}

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