!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/Matcher/Dumper/   drwxr-xr-x
Free 116.5 GB of 200.55 GB (58.09%)
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 ::
 
[ 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.0125 ]--