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


Viewing file:     DbalLoggerTest.php (4.19 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\Doctrine\Tests\Logger;

use 
Symfony\Bridge\Doctrine\Logger\DbalLogger;

class 
DbalLoggerTest extends \PHPUnit_Framework_TestCase
{
    
/**
     * @dataProvider getLogFixtures
     */
    
public function testLog($sql$params$logParams)
    {
        
$logger $this->getMock('Psr\\Log\\LoggerInterface');

        
$dbalLogger $this
            
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
            ->
setConstructorArgs(array($loggernull))
            ->
setMethods(array('log'))
            ->
getMock()
        ;

        
$dbalLogger
            
->expects($this->once())
            ->
method('log')
            ->
with($sql$logParams)
        ;

        
$dbalLogger->startQuery($sql$params);
    }

    public function 
getLogFixtures()
    {
        return array(
            array(
'SQL'null, array()),
            array(
'SQL', array(), array()),
            array(
'SQL', array('foo' => 'bar'), array('foo' => 'bar'))
        );
    }

    public function 
testLogNonUtf8()
    {
        
$logger $this->getMock('Psr\\Log\\LoggerInterface');

        
$dbalLogger $this
            
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
            ->
setConstructorArgs(array($loggernull))
            ->
setMethods(array('log'))
            ->
getMock()
        ;

        
$dbalLogger
            
->expects($this->once())
            ->
method('log')
            ->
with('SQL', array('utf8' => 'foo''nonutf8' => DbalLogger::BINARY_DATA_VALUE))
        ;

        
$dbalLogger->startQuery('SQL', array(
            
'utf8'    => 'foo',
            
'nonutf8' => "\x7F\xFF",
        ));
    }

    public function 
testLogLongString()
    {
        
$logger $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface');

        
$dbalLogger $this
            
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
            ->
setConstructorArgs(array($loggernull))
            ->
setMethods(array('log'))
            ->
getMock()
        ;

        
$testString 'abc';

        
$shortString str_pad(''DbalLogger::MAX_STRING_LENGTH$testString);
        
$longString str_pad(''DbalLogger::MAX_STRING_LENGTH+1$testString);

        
$dbalLogger
            
->expects($this->once())
            ->
method('log')
            ->
with('SQL', array('short' => $shortString'long' => substr($longString0DbalLogger::MAX_STRING_LENGTH 6).' [...]'))
        ;

        
$dbalLogger->startQuery('SQL', array(
            
'short' => $shortString,
            
'long'  => $longString,
        ));
    }

    public function 
testLogUTF8LongString()
    {
        if (!
function_exists('mb_detect_encoding')) {
            
$this->markTestSkipped('Testing log shortening of utf8 charsets requires the mb_detect_encoding() function.');
        }

        
$logger $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface');

        
$dbalLogger $this
            
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
            ->
setConstructorArgs(array($loggernull))
            ->
setMethods(array('log'))
            ->
getMock()
        ;

        
$testStringArray = array('é''á''ű''ő''ú''ö''ü''ó''í');
        
$testStringCount count($testStringArray);

        
$shortString '';
        
$longString '';
        for (
$i 1$i <= DbalLogger::MAX_STRING_LENGTH$i++) {
            
$shortString .= $testStringArray[$i $testStringCount];
            
$longString .= $testStringArray[$i $testStringCount];
        }
        
$longString .= $testStringArray[$i $testStringCount];

        
$dbalLogger
            
->expects($this->once())
            ->
method('log')
            ->
with('SQL', array('short' => $shortString'long' => mb_substr($longString0DbalLogger::MAX_STRING_LENGTH 6mb_detect_encoding($longString)).' [...]'))
        ;

        
$dbalLogger->startQuery('SQL', array(
                
'short' => $shortString,
                
'long'  => $longString,
            ));
    }

}

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