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


Viewing file:     DelegatingEngineTest.php (5.18 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\Templating\Tests;

use 
Symfony\Component\Templating\DelegatingEngine;
use 
Symfony\Component\Templating\StreamingEngineInterface;
use 
Symfony\Component\Templating\EngineInterface;

class 
DelegatingEngineTest extends \PHPUnit_Framework_TestCase
{
    public function 
testRenderDelegatesToSupportedEngine()
    {
        
$firstEngine $this->getEngineMock('template.php'false);
        
$secondEngine $this->getEngineMock('template.php'true);

        
$secondEngine->expects($this->once())
            ->
method('render')
            ->
with('template.php', array('foo' => 'bar'))
            ->
will($this->returnValue('<html />'));

        
$delegatingEngine = new DelegatingEngine(array($firstEngine$secondEngine));
        
$result $delegatingEngine->render('template.php', array('foo' => 'bar'));

        
$this->assertSame('<html />'$result);
    }

    
/**
     * @expectedException \RuntimeException
     * @expectedExceptionMessage No engine is able to work with the template "template.php"
     */
    
public function testRenderWithNoSupportedEngine()
    {
        
$firstEngine $this->getEngineMock('template.php'false);
        
$secondEngine $this->getEngineMock('template.php'false);

        
$delegatingEngine = new DelegatingEngine(array($firstEngine$secondEngine));
        
$delegatingEngine->render('template.php', array('foo' => 'bar'));
    }

    public function 
testStreamDelegatesToSupportedEngine()
    {
        
$streamingEngine $this->getStreamingEngineMock('template.php'true);
        
$streamingEngine->expects($this->once())
            ->
method('stream')
            ->
with('template.php', array('foo' => 'bar'))
            ->
will($this->returnValue('<html />'));

        
$delegatingEngine = new DelegatingEngine(array($streamingEngine));
        
$result $delegatingEngine->stream('template.php', array('foo' => 'bar'));

        
$this->assertNull($result);
    }

    
/**
     * @expectedException \LogicException
     * @expectedExceptionMessage Template "template.php" cannot be streamed as the engine supporting it does not implement StreamingEngineInterface
     */
    
public function testStreamRequiresStreamingEngine()
    {
        
$engine $this->getEngineMock('template.php'true);
        
$engine->expects($this->never())->method('stream');

        
$delegatingEngine = new DelegatingEngine(array($engine));
        
$delegatingEngine->stream('template.php', array('foo' => 'bar'));
    }

    public function 
testExists()
    {
        
$engine $this->getEngineMock('template.php'true);
        
$engine->expects($this->once())
            ->
method('exists')
            ->
with('template.php')
            ->
will($this->returnValue(true));

        
$delegatingEngine = new DelegatingEngine(array($engine));

        
$this->assertTrue($delegatingEngine->exists('template.php'));
    }

    public function 
testSupports()
    {
        
$engine $this->getEngineMock('template.php'true);

        
$delegatingEngine = new DelegatingEngine(array($engine));

        
$this->assertTrue($delegatingEngine->supports('template.php'));
    }

    public function 
testSupportsWithNoSupportedEngine()
    {
        
$engine $this->getEngineMock('template.php'false);

        
$delegatingEngine = new DelegatingEngine(array($engine));

        
$this->assertFalse($delegatingEngine->supports('template.php'));
    }

    public function 
testGetExistingEngine()
    {
        
$firstEngine $this->getEngineMock('template.php'false);
        
$secondEngine $this->getEngineMock('template.php'true);

        
$delegatingEngine = new DelegatingEngine(array($firstEngine$secondEngine));

        
$this->assertSame($secondEngine$delegatingEngine->getEngine('template.php'));
    }

    
/**
     * @expectedException \RuntimeException
     * @expectedExceptionMessage No engine is able to work with the template "template.php"
     */
    
public function testGetInvalidEngine()
    {
        
$firstEngine $this->getEngineMock('template.php'false);
        
$secondEngine $this->getEngineMock('template.php'false);

        
$delegatingEngine = new DelegatingEngine(array($firstEngine$secondEngine));
        
$delegatingEngine->getEngine('template.php', array('foo' => 'bar'));
    }

    private function 
getEngineMock($template$supports)
    {
        
$engine $this->getMock('Symfony\Component\Templating\EngineInterface');

        
$engine->expects($this->once())
            ->
method('supports')
            ->
with($template)
            ->
will($this->returnValue($supports));

        return 
$engine;
    }

    private function 
getStreamingEngineMock($template$supports)
    {
        
$engine $this->getMockForAbstractClass('Symfony\Component\Templating\Tests\MyStreamingEngine');

        
$engine->expects($this->once())
            ->
method('supports')
            ->
with($template)
            ->
will($this->returnValue($supports));

        return 
$engine;
    }
}

interface 
MyStreamingEngine extends StreamingEngineInterfaceEngineInterface
{
}

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