!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/nunomaduro/collision/src/Adapters/Phpunit/   drwxr-xr-x
Free 12.97 GB of 57.97 GB (22.37%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     TestResult.php (4.44 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

declare(strict_types=1);

namespace 
NunoMaduro\Collision\Adapters\Phpunit;

use 
NunoMaduro\Collision\Contracts\Adapters\Phpunit\HasPrintableTestCaseName;
use 
PHPUnit\Framework\TestCase;
use 
Throwable;

/**
 * @internal
 */
final class TestResult
{
    public const 
FAIL       'failed';
    public const 
SKIPPED    'skipped';
    public const 
INCOMPLETE 'incompleted';
    public const 
RISKY      'risked';
    public const 
WARN       'warnings';
    public const 
RUNS       'pending';
    public const 
PASS       'passed';

    
/**
     * @readonly
     *
     * @var string
     */
    
public $testCaseName;

    
/**
     * @readonly
     *
     * @var string
     */
    
public $description;

    
/**
     * @readonly
     *
     * @var string
     */
    
public $type;

    
/**
     * @readonly
     *
     * @var string
     */
    
public $icon;

    
/**
     * @readonly
     *
     * @var string
     */
    
public $color;

    
/**
     * @readonly
     *
     * @var Throwable|null
     */
    
public $throwable;

    
/**
     * @readonly
     *
     * @var string
     */
    
public $warning '';

    
/**
     * Test constructor.
     */
    
private function __construct(string $testCaseNamestring $descriptionstring $typestring $iconstring $colorThrowable $throwable null)
    {
        
$this->testCaseName $testCaseName;
        
$this->description  $description;
        
$this->type         $type;
        
$this->icon         $icon;
        
$this->color        $color;
        
$this->throwable    $throwable;

        
$asWarning $this->type === TestResult::WARN
             
|| $this->type === TestResult::RISKY
             
|| $this->type === TestResult::SKIPPED
             
|| $this->type === TestResult::INCOMPLETE;

        if (
$throwable instanceof Throwable && $asWarning) {
            
$this->warning     trim((string) preg_replace("/\r|\n/"' '$throwable->getMessage()));
        }
    }

    
/**
     * Creates a new test from the given test case.
     */
    
public static function fromTestCase(TestCase $testCasestring $typeThrowable $throwable null): self
    
{
        
$testCaseName State::getPrintableTestCaseName($testCase);

        
$description self::makeDescription($testCase);

        
$icon self::makeIcon($type);

        
$color self::makeColor($type);

        return new 
self($testCaseName$description$type$icon$color$throwable);
    }

    
/**
     * Get the test case description.
     */
    
public static function makeDescription(TestCase $testCase): string
    
{
        
$name $testCase->getName(false);

        if (
$testCase instanceof HasPrintableTestCaseName) {
            return 
$name;
        }

        
// First, lets replace underscore by spaces.
        
$name str_replace('_'' '$name);

        
// Then, replace upper cases by spaces.
        
$name = (string) preg_replace('/([A-Z])/'' $1'$name);

        
// Finally, if it starts with `test`, we remove it.
        
$name = (string) preg_replace('/^test/'''$name);

        
// Removes spaces
        
$name trim($name);

        
// Lower case everything
        
$name mb_strtolower($name);

        
// Add the dataset name if it has one
        
if ($dataName $testCase->dataName()) {
            if (
is_int($dataName)) {
                
$name .= sprintf(' with data set #%d'$dataName);
            } else {
                
$name .= sprintf(' with data set "%s"'$dataName);
            }
        }

        return 
$name;
    }

    
/**
     * Get the test case icon.
     */
    
public static function makeIcon(string $type): string
    
{
        switch (
$type) {
            case 
self::FAIL:
                return 
'⨯';
            case 
self::SKIPPED:
                return 
'-';
            case 
self::RISKY:
                return 
'!';
            case 
self::INCOMPLETE:
                return 
'…';
            case 
self::WARN:
                return 
'!';
            case 
self::RUNS:
                return 
'•';
            default:
                return 
'✓';
        }
    }

    
/**
     * Get the test case color.
     */
    
public static function makeColor(string $type): string
    
{
        switch (
$type) {
            case 
self::FAIL:
                return 
'red';
            case 
self::SKIPPED:
            case 
self::INCOMPLETE:
            case 
self::RISKY:
            case 
self::WARN:
            case 
self::RUNS:
                return 
'yellow';
            default:
                return 
'green';
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0058 ]--