!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/laravel/framework/src/Illuminate/Foundation/Testing/   drwxr-xr-x
Free 13.19 GB of 57.97 GB (22.76%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Illuminate\Foundation\Testing;

use 
Carbon\Carbon;
use 
Carbon\CarbonImmutable;
use 
Illuminate\Console\Application as Artisan;
use 
Illuminate\Database\Eloquent\Model;
use 
Illuminate\Queue\Queue;
use 
Illuminate\Support\Facades\Facade;
use 
Illuminate\Support\Facades\ParallelTesting;
use 
Illuminate\Support\Str;
use 
Mockery;
use 
Mockery\Exception\InvalidCountException;
use 
PHPUnit\Framework\TestCase as BaseTestCase;
use 
Throwable;

abstract class 
TestCase extends BaseTestCase
{
    use 
Concerns\InteractsWithContainer,
        
Concerns\MakesHttpRequests,
        
Concerns\InteractsWithAuthentication,
        
Concerns\InteractsWithConsole,
        
Concerns\InteractsWithDatabase,
        
Concerns\InteractsWithExceptionHandling,
        
Concerns\InteractsWithSession,
        
Concerns\InteractsWithTime,
        
Concerns\InteractsWithViews,
        
Concerns\MocksApplicationServices;

    
/**
     * The Illuminate application instance.
     *
     * @var \Illuminate\Contracts\Foundation\Application
     */
    
protected $app;

    
/**
     * The callbacks that should be run after the application is created.
     *
     * @var array
     */
    
protected $afterApplicationCreatedCallbacks = [];

    
/**
     * The callbacks that should be run before the application is destroyed.
     *
     * @var array
     */
    
protected $beforeApplicationDestroyedCallbacks = [];

    
/**
     * The exception thrown while running an application destruction callback.
     *
     * @var \Throwable
     */
    
protected $callbackException;

    
/**
     * Indicates if we have made it through the base setUp function.
     *
     * @var bool
     */
    
protected $setUpHasRun false;

    
/**
     * Creates the application.
     *
     * Needs to be implemented by subclasses.
     *
     * @return \Symfony\Component\HttpKernel\HttpKernelInterface
     */
    
abstract public function createApplication();

    
/**
     * Setup the test environment.
     *
     * @return void
     */
    
protected function setUp(): void
    
{
        
Facade::clearResolvedInstances();

        if (! 
$this->app) {
            
$this->refreshApplication();

            
ParallelTesting::callSetUpTestCaseCallbacks($this);
        }

        
$this->setUpTraits();

        foreach (
$this->afterApplicationCreatedCallbacks as $callback) {
            
$callback();
        }

        
Model::setEventDispatcher($this->app['events']);

        
$this->setUpHasRun true;
    }

    
/**
     * Refresh the application instance.
     *
     * @return void
     */
    
protected function refreshApplication()
    {
        
$this->app $this->createApplication();
    }

    
/**
     * Boot the testing helper traits.
     *
     * @return array
     */
    
protected function setUpTraits()
    {
        
$uses array_flip(class_uses_recursive(static::class));

        if (isset(
$uses[RefreshDatabase::class])) {
            
$this->refreshDatabase();
        }

        if (isset(
$uses[DatabaseMigrations::class])) {
            
$this->runDatabaseMigrations();
        }

        if (isset(
$uses[DatabaseTransactions::class])) {
            
$this->beginDatabaseTransaction();
        }

        if (isset(
$uses[WithoutMiddleware::class])) {
            
$this->disableMiddlewareForAllTests();
        }

        if (isset(
$uses[WithoutEvents::class])) {
            
$this->disableEventsForAllTests();
        }

        if (isset(
$uses[WithFaker::class])) {
            
$this->setUpFaker();
        }

        return 
$uses;
    }

    
/**
     * Clean up the testing environment before the next test.
     *
     * @return void
     *
     * @throws \Mockery\Exception\InvalidCountException
     */
    
protected function tearDown(): void
    
{
        if (
$this->app) {
            
$this->callBeforeApplicationDestroyedCallbacks();

            
ParallelTesting::callTearDownTestCaseCallbacks($this);

            
$this->app->flush();

            
$this->app null;
        }

        
$this->setUpHasRun false;

        if (
property_exists($this'serverVariables')) {
            
$this->serverVariables = [];
        }

        if (
property_exists($this'defaultHeaders')) {
            
$this->defaultHeaders = [];
        }

        if (
class_exists('Mockery')) {
            if (
$container Mockery::getContainer()) {
                
$this->addToAssertionCount($container->mockery_getExpectationCount());
            }

            try {
                
Mockery::close();
            } catch (
InvalidCountException $e) {
                if (! 
Str::contains($e->getMethodName(), ['doWrite''askQuestion'])) {
                    throw 
$e;
                }
            }
        }

        if (
class_exists(Carbon::class)) {
            
Carbon::setTestNow();
        }

        if (
class_exists(CarbonImmutable::class)) {
            
CarbonImmutable::setTestNow();
        }

        
$this->afterApplicationCreatedCallbacks = [];
        
$this->beforeApplicationDestroyedCallbacks = [];

        
Artisan::forgetBootstrappers();

        
Queue::createPayloadUsing(null);

        if (
$this->callbackException) {
            throw 
$this->callbackException;
        }
    }

    
/**
     * Register a callback to be run after the application is created.
     *
     * @param  callable  $callback
     * @return void
     */
    
public function afterApplicationCreated(callable $callback)
    {
        
$this->afterApplicationCreatedCallbacks[] = $callback;

        if (
$this->setUpHasRun) {
            
$callback();
        }
    }

    
/**
     * Register a callback to be run before the application is destroyed.
     *
     * @param  callable  $callback
     * @return void
     */
    
protected function beforeApplicationDestroyed(callable $callback)
    {
        
$this->beforeApplicationDestroyedCallbacks[] = $callback;
    }

    
/**
     * Execute the application's pre-destruction callbacks.
     *
     * @return void
     */
    
protected function callBeforeApplicationDestroyedCallbacks()
    {
        foreach (
$this->beforeApplicationDestroyedCallbacks as $callback) {
            try {
                
$callback();
            } catch (
Throwable $e) {
                if (! 
$this->callbackException) {
                    
$this->callbackException $e;
                }
            }
        }
    }
}

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