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


Viewing file:     FileLoaderTest.php (3.87 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\Config\Tests\Loader;

use 
Symfony\Component\Config\Loader\FileLoader;
use 
Symfony\Component\Config\Loader\LoaderResolver;
use 
Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException;

class 
FileLoaderTest extends \PHPUnit_Framework_TestCase
{
    
/**
     * @covers Symfony\Component\Config\Loader\FileLoader
     */
    
public function testImportWithFileLocatorDelegation()
    {
        
$locatorMock $this->getMock('Symfony\Component\Config\FileLocatorInterface');

        
$locatorMockForAdditionalLoader $this->getMock('Symfony\Component\Config\FileLocatorInterface');
        
$locatorMockForAdditionalLoader->expects($this->any())->method('locate')->will($this->onConsecutiveCalls(
                array(
'path/to/file1'),                    // Default
                
array('path/to/file1''path/to/file2'),   // First is imported
                
array('path/to/file1''path/to/file2'),   // Second is imported
                
array('path/to/file1'),                    // Exception
                
array('path/to/file1''path/to/file2')    // Exception
                
));

        
$fileLoader = new TestFileLoader($locatorMock);
        
$fileLoader->setSupports(false);
        
$fileLoader->setCurrentDir('.');

        
$additionalLoader = new TestFileLoader($locatorMockForAdditionalLoader);
        
$additionalLoader->setCurrentDir('.');

        
$fileLoader->setResolver($loaderResolver = new LoaderResolver(array($fileLoader$additionalLoader)));

        
// Default case
        
$this->assertSame('path/to/file1'$fileLoader->import('my_resource'));

        
// Check first file is imported if not already loading
        
$this->assertSame('path/to/file1'$fileLoader->import('my_resource'));

        
// Check second file is imported if first is already loading
        
$fileLoader->addLoading('path/to/file1');
        
$this->assertSame('path/to/file2'$fileLoader->import('my_resource'));

        
// Check exception throws if first (and only available) file is already loading
        
try {
            
$fileLoader->import('my_resource');
            
$this->fail('->import() throws a FileLoaderImportCircularReferenceException if the resource is already loading');
        } catch (\
Exception $e) {
            
$this->assertInstanceOf('Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException'$e'->import() throws a FileLoaderImportCircularReferenceException if the resource is already loading');
        }

        
// Check exception throws if all files are already loading
        
try {
            
$fileLoader->addLoading('path/to/file2');
            
$fileLoader->import('my_resource');
            
$this->fail('->import() throws a FileLoaderImportCircularReferenceException if the resource is already loading');
        } catch (\
Exception $e) {
            
$this->assertInstanceOf('Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException'$e'->import() throws a FileLoaderImportCircularReferenceException if the resource is already loading');
        }
    }
}

class 
TestFileLoader extends FileLoader
{
    private 
$supports true;

    public function 
load($resource$type null)
    {
        return 
$resource;
    }

    public function 
supports($resource$type null)
    {
        return 
$this->supports;
    }

    public function 
addLoading($resource)
    {
        
self::$loading[$resource] = true;
    }

    public function 
removeLoading($resource)
    {
        unset(
self::$loading[$resource]);
    }

    public function 
clearLoading()
    {
        
self::$loading = array();
    }

    public function 
setSupports($supports)
    {
        
$this->supports $supports;
    }
}

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