!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/php55/usr/share/pear/test/TwigBridge/Symfony/Bridge/Twig/Tests/Extension/   drwxr-xr-x
Free 291.68 GB of 429.69 GB (67.88%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     StopwatchExtensionTest.php (2.44 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\Bridge\Twig\Tests\Extension;

use 
Symfony\Bridge\Twig\Extension\StopwatchExtension;

class 
StopwatchExtensionTest extends \PHPUnit_Framework_TestCase
{
    
/**
     * @expectedException \Twig_Error_Syntax
     */
    
public function testFailIfStoppingWrongEvent()
    {
        
$this->testTiming('{% stopwatch "foo" %}{% endstopwatch "bar" %}', array());
    }

    
/**
     * @dataProvider getTimingTemplates
     */
    
public function testTiming($template$events)
    {
        
$twig = new \Twig_Environment(new \Twig_Loader_String(), array('debug' => true'cache' => false'autoescape' => true'optimizations' => 0));
        
$twig->addExtension(new StopwatchExtension($this->getStopwatch($events)));

        try {
            
$nodes $twig->render($template);
        } catch (\
Twig_Error_Runtime $e) {
            throw 
$e->getPrevious();
        }
    }

    public function 
getTimingTemplates()
    {
        return array(
            array(
'{% stopwatch "foo" %}something{% endstopwatch %}''foo'),
            array(
'{% stopwatch "foo" %}symfony2 is fun{% endstopwatch %}{% stopwatch "bar" %}something{% endstopwatch %}', array('foo''bar')),
            array(
'{% set foo = "foo" %}{% stopwatch foo %}something{% endstopwatch %}''foo'),
            array(
'{% set foo = "foo" %}{% stopwatch foo %}something {% set foo = "bar" %}{% endstopwatch %}''foo'),
            array(
'{% stopwatch "foo.bar" %}something{% endstopwatch %}''foo.bar'),
            array(
'{% stopwatch "foo" %}something{% endstopwatch %}{% stopwatch "foo" %}something else{% endstopwatch %}', array('foo''foo')),
        );
    }

    protected function 
getStopwatch($events = array())
    {
        
$events is_array($events) ? $events : array($events);
        
$stopwatch $this->getMock('Symfony\Component\Stopwatch\Stopwatch');

        
$i = -1;
        foreach (
$events as $eventName) {
            
$stopwatch->expects($this->at(++$i))
                ->
method('start')
                ->
with($this->equalTo($eventName), 'template')
            ;
            
$stopwatch->expects($this->at(++$i))
                ->
method('stop')
                ->
with($this->equalTo($eventName))
            ;
        }

        return 
$stopwatch;
    }
}

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