rnel;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Router;
use PHPUnit\Framework\TestCase;

class KernelTest extends TestCase
{
    public function testGetMiddlewareGroups()
    {
        $kernel = new Kernel($this->getApplication(), $this->getRouter());

        $this->assertSame([], $kernel->getMiddlewareGroups());
    }

    public function testGetRouteMiddleware()
    {
        $kernel = new Kernel($this->getApplication(), $this->getRouter());

        $this->assertS

e\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
            \Illuminate\Cookie\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSe

ame([], $kernel->getRouteMiddleware());
    }

    public function testGetMiddlewarePriority()
    {
        $kernel = new Kernel($this->getApplication(), $this->getRouter());

        $this->assertEquals([
            \Illuminat


okie\Middleware\EncryptCookies;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use Illuminate\Foundation\Http\Middleware\PreventRequestForgery;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance;
use Illuminate\Foundation\Http\Middleware\TrimStrings;
use Illuminate\Http\Middleware\TrustHosts;
use Illuminate\Http\Middleware\TrustProxies;
use Illuminate\Http\Request;
use Illuminate\Session\Middleware\Authenticate

{
        Container::setInstance(null);
        ConvertEmptyStringsToNull::flushState();
        EncryptCookies::flushState();
        PreventRequestForgery::flushState();
        PreventRequestsDuringMaintenance::flushState();
        TrimStrings::flushSt

Session;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use ReflectionClass;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;

class MiddlewareTest extends TestCase
{
    protected function tearDown(): void


g;

use Illuminate\Foundation\Testing\DatabaseTransactionsManager;
use PHPUnit\Framework\TestCase;

class DatabaseTransactionsManagerTest extends TestCase
{
    public function testItExecutesCallbacksImmediatelyIfThereIsOnlyOneTransaction()
    {
        $testObject = new TestingDatabaseTransactionsManagerTestObject;
        $manager = new DatabaseTransactionsManager([null]);

        $manager->begin('foo', 1);

        $manager->addCallback(fn () => $testObject->handle());

        $this->assertTrue($testO

    $manager->begin('foo', 1);
        $manager->begin('foo', 2);

        $this->assertCount(1, $manager->callbackApplicableTransactions());
        $this->assertEquals(2, $manager->callbackApplicableTransactions()[0]->level);
    }

    public function t

bject->ran);
        $this->assertEquals(1, $testObject->runs);
    }

    public function testItIgnoresTheBaseTransactionForCallbackApplicableTransactions()
    {
        $manager = new DatabaseTransactionsManager([null]);


g;

use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Foundation\Testing\Concerns\InteractsWithConsole;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\RefreshDatabaseState;
use Mockery as m;
use Orchestra\Testbench\Concerns\ApplicationTestingHooks;
use Orchestra\Testbench\Foundation\Application as Testbench;
use PHPUnit\Framework\TestCase;

use function Orchestra\Testbench\package_

etUp(): void
    {
        RefreshDatabaseState::$migrated = false;

        $this->setUpTheApplicationTestingHooks();
        $this->withoutMockingConsoleOutput();
    }

    protected function tearDown(): void
    {
        $this->tearDownTheApplicationT

path;

class RefreshDatabaseTest extends TestCase
{
    use ApplicationTestingHooks;
    use InteractsWithConsole;
    use RefreshDatabase;

    public $dropViews = false;

    public $dropTypes = false;

    protected function s


g\Traits;

use Illuminate\Foundation\Testing\Traits\CanConfigureMigrationCommands;
use PHPUnit\Framework\TestCase;
use ReflectionMethod;

class CanConfigureMigrationCommandsTest extends TestCase
{
    protected $traitObject;

    protected function setUp(): void
    {
        $this->traitObject = new CanConfigureMigrationCommandsTestMockClass();
    }

    private function __reflectAndSetupAccessibleForProtectedTraitMethod($methodName)
    {
        return new ReflectionMethod(
            get_class($this->

Using');

        $expected = [
            '--drop-views' => false,
            '--drop-types' => false,
            '--seed' => false,
        ];

        $this->assertEquals($expected, $migrateFreshUsingReflection->invoke($this->traitObject));
    }

traitObject),
            $methodName
        );
    }

    public function testMigrateFreshUsingDefault(): void
    {
        $migrateFreshUsingReflection = $this->__reflectAndSetupAccessibleForProtectedTraitMethod('migrateFresh


uminate\Foundation\Vite;
use Illuminate\Support\Defer\DeferredCallbackCollection;
use Orchestra\Testbench\TestCase;
use stdClass;

class InteractsWithContainerTest extends TestCase
{
    public function testWithoutViteBindsEmptyHandlerAndReturnsInstance()
    {
        $instance = $this->withoutVite();

        $this->assertSame('', app(Vite::class)(['resources/js/app.js'])->toHtml());
        $this->assertSame($this, $instance);
    }

    public function testWithoutViteHandlesReactRefresh()
    {

this->withoutVite();

        $this->assertSame('', app(Vite::class)->asset('path/to/asset.png'));
        $this->assertSame($this, $instance);
    }

    public function testWithViteRestoresOriginalHandlerAndReturnsInstance()
    {
        $handler = new

$instance = $this->withoutVite();

        $this->assertSame('', app(Vite::class)->reactRefresh());
        $this->assertSame($this, $instance);
    }

    public function testWithoutViteHandlesAsset()
    {
        $instance = $


recognitiveRequests;
use Illuminate\Http\RedirectResponse;
use Orchestra\Testbench\TestCase;

class MakesHttpRequestsTest extends TestCase
{
    public function testFromSetsHeaderAndSession()
    {
        $this->from('previous/url');

        $this->assertSame('previous/url', $this->defaultHeaders['referer']);
        $this->assertSame('previous/url', $this->app['session']->previousUrl());
    }

    public function testFromRouteSetsHeaderAndSession()
    {
        $router = $this->app->make(Registrar::cla

his->assertSame('http://localhost/previous/url', $this->app['session']->previousUrl());
    }

    public function testFromRemoveHeader()
    {
        $this->withHeader('name', 'Milwad')->from('previous/url');

        $this->assertSame('Milwad', $this->d

ss);

        $router->get('previous/url', fn () => 'ok')->name('previous-url');

        $this->fromRoute('previous-url');

        $this->assertSame('http://localhost/previous/url', $this->defaultHeaders['referer']);
        $t


ework\TestCase;

class AuthenticatableTest extends TestCase
{
    public function testItReturnsSameRememberTokenForString()
    {
        $user = new User;
        $user->setRememberToken('sample_token');
        $this->assertSame('sample_token', $user->getRememberToken());
    }

    public function testItReturnsStringAsRememberTokenWhenItWasSetToTrue()
    {
        $user = new User;
        $user->setRememberToken(true);
        $this->assertSame('1', $user->getRememberToken());
    }

    public functio

y()
    {
        $user = new class extends User
        {
            public function getRememberTokenName()
            {
                return '';
            }
        };
        $user->setRememberToken(true);
        $this->assertNull($user->getRemem


xception;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class FoundationFormRequestTest extends TestCase
{
    protected $mocks = [];

    protected function tearDown(): void
    {
        FormRequest::failOnUnknownFields(false);

        Container::setInstance(null);

        $this->mocks = [];

        parent::tearDown();
    }

    public function testValidatedMethodReturnsTheValidatedData()
    {
        $request = $this->createRequest(['name' => 'specified', 'with' => 'extras']);

        $request

> 'bar', 'baz' => ''], 'array' => [1, 2]];

        $request = $this->createRequest($payload, FoundationTestFormRequestNestedStub::class);

        $request->validateResolved();

        $this->assertEquals(['nested' => ['foo' => 'bar'], 'array' => [1, 2]]

->validateResolved();

        $this->assertEquals(['name' => 'specified'], $request->validated());
    }

    public function testValidatedMethodReturnsTheValidatedDataNestedRules()
    {
        $payload = ['nested' => ['foo' =


ion setUp(): void
    {
        $this->connection = m::mock(Connection::class);
    }

    public function testSeeInDatabaseFindsResults()
    {
        $this->mockCountBuilder(true);

        $this->assertDatabaseHas($this->table, $this->data);
    }

    public function testAssertDatabaseHasSupportsModelClass()
    {
        $this->mockCountBuilder(true);

        $this->assertDatabaseHas(ProductStub::class, $this->data);
    }

    public function testAssertDatabaseHasConstrainsToModel()
    {
        $d

public function testAssertDatabaseSupportsArrays()
    {
        $builder = m::mock(Builder::class);
        $builder->shouldReceive('where')->with(['title' => 'Spark', 'name' => 'Laravel'])->once()->andReturnSelf();
        $builder->shouldReceive('where'

ata = $this->data;

        $this->data = [
            'id' => 1,
            ...$this->data,
        ];

        $this->mockCountBuilder(true);

        $this->assertDatabaseHas(new ProductStub(['id' => 1]), $data);
    }


nts();

        $this->assertStringContainsString(
            '<link rel="preload" as="font" href="https://example.com/build/assets/inter-400.woff2" type="font/woff2" crossorigin="anonymous" />',
            $result->toHtml()
        );
        $this->assertStringContainsString(
            "<style>\n@font-face { font-family: 'Inter'; src: url('../fonts/inter-400.woff2') format('woff2'); }\n</style>",
            $result->toHtml()
        );
    }

    public function testFontsRendersPreloadsBeforeStyle()

 strpos($result, '<link rel="preload"');
        $stylePos = strpos($result, '<style>');

        $this->assertNotFalse($preloadPos);
        $this->assertNotFalse($stylePos);
        $this->assertLessThan($stylePos, $preloadPos);
    }

    public functio

    {
        $this->makeFontsManifest();
        $this->makeFontsCssFile('build', 'assets/fonts-abc123.css', "@font-face { font-family: 'Inter'; }");

        $result = app(Vite::class)->fonts()->toHtml();

        $preloadPos =


dation\LaravelCloudJsonFormatter;
use Illuminate\Http\Request;
use Monolog\Level;
use Monolog\LogRecord;
use PHPUnit\Framework\TestCase;

class LaravelCloudJsonFormatterTest extends TestCase
{
    protected function setUp(): void
    {
        parent::setUp();
        Container::setInstance(new Container);
    }

    protected function tearDown(): void
    {
        Container::setInstance(null);
        parent::tearDown();
    }

    protected function createRecord(): LogRecord
    {
        return new LogR

unction test_adds_cloud_request_id_as_top_level_key()
    {
        $app = Container::getInstance();
        $request = Request::create('/');
        $request->headers->set('Cloud-Request-ID', '550e8400-e29b-41d4-a716-446655440000');
        $app->instance

ecord(
            message: 'Test message',
            level: Level::Info,
            channel: 'test',
            datetime: new \DateTimeImmutable,
            extra: [],
            context: [],
        );
    }

    public f


rap;

use Closure;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Bootstrap\LoadConfiguration;
use PHPUnit\Framework\TestCase;
use ReflectionClass;

class LoadConfigurationTest extends TestCase
{
    public function testLoadsBaseConfiguration()
    {
        $app = new Application();

        (new LoadConfiguration)->bootstrap($app);

        $this->assertSame('Laravel', $app['config']['app.name']);
    }

    public function testSetsEnvironmentResolve

anceOf(
            Closure::class,
            (new ReflectionClass($app))->getProperty('environmentResolver')->getValue($app)
        );
    }

    public function testDontLoadBaseConfiguration()
    {
        $app = new Application();
        $app->dont

r()
    {
        $app = new Application();
        $this->assertNull((new ReflectionClass($app))->getProperty('environmentResolver')->getValue($app));

        (new LoadConfiguration)->bootstrap($app);

        $this->assertInst


Worker::$restartable = true;
        Worker::$pausable = true;
        $_SERVER['LARAVEL_CLOUD'] = '1';
        $_SERVER['LARAVEL_CLOUD_MANAGED_QUEUES_CONFIG'] = json_encode([
            'driver' => 'cloud',
            'connection' => [
                'driver' => 'sqs',
                'region' => 'us-east-2',
                'prefix' => 'https://sqs.us-east-2.amazonaws.com/1234567',
                'suffix' => '-env-8280cf2c-2081-47e8-a1f1-9cdfcba8618f',
                'queue' => 'default',

     parent::tearDown();

        unset($_SERVER['LARAVEL_CLOUD'], $_SERVER['LARAVEL_CLOUD_MANAGED_QUEUES_CONFIG']);
        Worker::$restartable = true;
        Worker::$pausable = true;
    }

    public function testItDisablesQueueRestartPollingForManag

 ],
        ]);

        parent::setUp();

        $this->app['config']->set('queue.connections.cloud', json_decode($_SERVER['LARAVEL_CLOUD_MANAGED_QUEUES_CONFIG'], true));
    }

    protected function tearDown(): void
    {


pace Illuminate\Tests\Foundation\Console;

use Illuminate\Foundation\Console\AboutCommand;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

class AboutCommandTest extends TestCase
{
    /**
     * @param  \Closure(bool):mixed  $format
     * @param  mixed  $expected
     */
    #[DataProvider('cliDataProvider')]
    public function testItCanFormatForCliInterface($format, $expected)
    {
        $this->assertSame($expected, value($format, false));
    }

    public static func

'NO'), 'NO'];
    }

    /**
     * @param  \Closure(bool):mixed  $format
     * @param  mixed  $expected
     */
    #[DataProvider('jsonDataProvider')]
    public function testItCanFormatForJsonInterface($format, $expected)
    {
        $this->assertSam

tion cliDataProvider()
    {
        yield [AboutCommand::format(true, console: fn ($value) => $value === true ? 'YES' : 'NO'), 'YES'];
        yield [AboutCommand::format(false, console: fn ($value) => $value === true ? 'YES' :


 setUp(): void
    {
        parent::setUp();

        $this->app = new Application(
            $laravel = new \Illuminate\Foundation\Application(__DIR__),
            m::mock(Dispatcher::class, ['dispatch' => null, 'fire' => null]),
            'testing',
        );

        $router = new Router(m::mock('Illuminate\Events\Dispatcher'));

        $kernel = new class($laravel, $router) extends Kernel
        {
            protected $middlewareGroups = [
                'web' => ['Middleware 1', 'Middleware

eware 2',
                'Middleware 3',
            ];
        };

        $kernel->prependToMiddlewarePriority('Middleware 5');

        $laravel->instance(Kernel::class, $kernel);

        $router->get('/example', function () {
            return 'Hell

2', 'Middleware 5'],
                'auth' => ['Middleware 3', 'Middleware 4'],
            ];

            protected $middlewarePriority = [
                'Middleware 1',
                'Middleware 4',
                'Middl


g;

use Illuminate\Foundation\Testing\Attributes\SetUp;
use Illuminate\Foundation\Testing\Attributes\TearDown;
use Illuminate\Foundation\Testing\TestCase as FoundationTestCase;
use Orchestra\Testbench\Concerns\CreatesApplication;
use PHPUnit\Framework\TestCase;
use ReflectionMethod;

trait TestTrait
{
    public $setUp = false;
    public $tearDown = false;

    public function setUpTestTrait()
    {
        $this->setUp = true;
    }

    public function tearDownTestTrait()
    {
        $this->tearDown =

 #[TearDown]
    public function cleanUpSearch()
    {
        $this->attributeTearDown = true;
    }
}

class TestCaseWithTrait extends FoundationTestCase
{
    use CreatesApplication;
    use TestTrait;
}

class TestCaseWithAttributeTrait extends Foundat

true;
    }
}

trait TestTraitWithAttributes
{
    public $attributeSetUp = false;
    public $attributeTearDown = false;

    #[SetUp]
    public function initializeSearch()
    {
        $this->attributeSetUp = true;
    }


oleKernelContract;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Foundation\Testing\Concerns\InteractsWithConsole;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\RefreshDatabaseState;
use Mockery as m;
use Orchestra\Testbench\Concerns\ApplicationTestingHooks;
use Orchestra\Testbench\Foundation\Application as Testbench;
use PHPUnit\Framework\TestCase;

use function Orchestra\Testbench\package_path;

class DatabaseMigrationsTest extends Test

State::$migrated = false;

        $this->afterApplicationCreated(function () {
            $this->app['config']->set([
                'database.default' => 'testing',
                'database.connections.testing' => [
                    'driver' => 'sq

Case
{
    use ApplicationTestingHooks;
    use DatabaseMigrations;
    use InteractsWithConsole;

    public $dropViews = false;

    public $dropTypes = false;

    protected function setUp(): void
    {
        RefreshDatabase


g;

use Carbon\CarbonImmutable;
use Illuminate\Foundation\Testing\Wormhole;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Date;
use PHPUnit\Framework\TestCase;

class WormholeTest extends TestCase
{
    protected function tearDown(): void
    {
        Date::useDefault();

        parent::tearDown();
    }

    public function testCanTravelBackToPresent()
    {
        // Preserve the timelines we want to compare the reality with...
        $present = Date::now();
        $future = Date::now

sert we can go back to the present...
        $this->assertEquals($present->format('Y-m-d'), Wormhole::back()->format('Y-m-d'));
    }

    public function testCarbonImmutableCompatibility()
    {
        // Tell the Date Factory to use CarbonImmutable...

()->addDays(10);

        // Travel in time...
        (new Wormhole(10))->days();

        // Assert we are now in the future...
        $this->assertEquals($future->format('Y-m-d'), Date::now()->format('Y-m-d'));

        // As


Mockery as m;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use stdClass;

class CacheMemcachedConnectorTest extends TestCase
{
    public function testServersAreAddedCorrectly()
    {
        $memcached = $this->memcachedMockWithAddServer();

        $connector = $this->connectorMock();
        $connector->expects($this->once())
            ->method('createMemcachedInstance')
            ->willReturn($memcached);

        $result = $this->connect($connector);

edMockWithAddServer();

        $connector = $this->connectorMock();
        $connector->expects($this->once())
            ->method('createMemcachedInstance')
            ->with($persistentConnectionId)
            ->willReturn($memcached);

        $resu

   $this->assertSame($result, $memcached);
    }

    public function testServersAreAddedCorrectlyWithPersistentConnection()
    {
        $persistentConnectionId = 'persistent_connection_id';

        $memcached = $this->memcach


sion\Store;
use Illuminate\Support\MessageBag;
use Illuminate\Support\ViewErrorBag;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Cookie;

class HttpRedirectResponseTest extends TestCase
{
    public function testHeaderOnRedirect()
    {
        $response = new RedirectResponse('foo.bar');
        $this->assertNull($response->headers->get('foo'));
        $response->header('foo', 'bar');
        $this->assertSame('bar', $response->headers->get('foo'));
        $respo

tion testWithOnRedirect()
    {
        $response = new RedirectResponse('foo.bar');
        $response->setRequest(Request::create('/', 'GET', ['name' => 'Taylor', 'age' => 26]));
        $response->setSession($session = m::mock(Store::class));
        $se

nse->header('foo', 'baz', false);
        $this->assertSame('bar', $response->headers->get('foo'));
        $response->header('foo', 'baz');
        $this->assertSame('baz', $response->headers->get('foo'));
    }

    public func


ication as ApplicationContract;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\ProviderRepository;
use Illuminate\Support\ServiceProvider;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use stdClass;

class FoundationProviderRepositoryTest extends TestCase
{
    public function testServicesAreRegisteredWhenManifestIsNotRecompiled()
    {
        $app = m::mock(Application::class);

        $repo = m::mock(ProviderRepository::class.'[createProvider,l

iders'], 'when' => []]);
        $repo->shouldReceive('shouldRecompile')->once()->andReturn(false);

        $app->shouldReceive('register')->once()->with('foo');
        $app->shouldReceive('runningInConsole')->andReturn(false);
        $app->shouldReceiv

oadManifest,shouldRecompile]', [$app, m::mock(Filesystem::class), [__DIR__.'/services.php']]);
        $repo->shouldReceive('loadManifest')->once()->andReturn(['eager' => ['foo'], 'deferred' => ['deferred'], 'providers' => ['prov


dleExceptionsTest extends TestCase
{
    protected $app;
    protected $config;

    protected function setUp(): void
    {
        $this->app = m::mock(Application::setInstance(new Application));

        $this->app->instance('config', $this->config = new Config());
    }

    protected function handleExceptions()
    {
        return tap(new HandleExceptions(), function ($instance) {
            (new ReflectionClass($instance))->getProperty('app')->setValue($instance, $this->app);
        });
    }

    p

::mock(LogManager::class);
        $this->app->instance(LogManager::class, $logger);
        $this->app->expects('runningUnitTests')->andReturn(false);
        $this->app->expects('hasBeenBootstrapped')->andReturn(true);

        $logger->expects('channel'

rotected function tearDown(): void
    {
        Application::setInstance(null);
        HandleExceptions::flushState($this);

        parent::tearDown();
    }

    public function testPhpDeprecations()
    {
        $logger = m


pace Illuminate\Tests\Foundation\Bootstrap;

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class LoadEnvironmentVariablesTest extends TestCase
{
    protected function tearDown(): void
    {
        unset($_ENV['FOO'], $_SERVER['FOO']);
        putenv('FOO');

        parent::tearDown();
    }

    protected function getAppMock($file)
    {
        $app = m::mock(Application::class);

        $app->shou

         ->once()->with()->andReturn(__DIR__.'/../fixtures');
        $app->shouldReceive('environmentFile')
            ->once()->with()->andReturn($file);

        return $app;
    }

    public function testCanLoad()
    {
        $this->expectOutputStr

ldReceive('configurationIsCached')
            ->once()->with()->andReturn(false);
        $app->shouldReceive('runningInConsole')
            ->once()->with()->andReturn(false);
        $app->shouldReceive('environmentPath')


uration;

use Exception;
use Illuminate\Container\Container;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Exceptions\Handler;
use Illuminate\Http\Request;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpKernel\Exception\HttpException;

class ExceptionsTest extends TestCase
{
    public function testStopIgnoring()
    {
        $container = new Container;
        $exceptions = new Exceptions($handler = new cla

>assertContains(HttpException::class, $handler->getDontReport());
        $exceptions = $exceptions->stopIgnoring(HttpException::class);
        $this->assertInstanceOf(Exceptions::class, $exceptions);
        $this->assertNotContains(HttpException::class,

ss($container) extends Handler
        {
            public function getDontReport(): array
            {
                return array_merge($this->dontReport, $this->internalDontReport);
            }
        });

        $this-


    use DatabaseTruncation;

    private ?array $app;

    private ?array $tablesToTruncate = null;

    private ?array $exceptTables = null;

    protected function setUp(): void
    {
        parent::setUp();

        $this->app['config'] = new Repository([
            'database' => [
                'migrations' => [
                    'table' => 'migrations',
                ],
            ],
        ]);
    }

    protected function tearDown(): void
    {
        $this->app = null;
        static::$a

edTables, [
            ['schema' => null, 'name' => 'foo', 'schema_qualified_name' => 'foo'],
            ['schema' => null, 'name' => 'bar', 'schema_qualified_name' => 'bar'],
        ]);

        $this->truncateTablesForConnection($connection, 'test');

llTables = [];
        $this->tablesToTruncate = null;
        $this->exceptTables = null;

        parent::tearDown();
    }

    public function testTruncateTables()
    {
        $connection = $this->arrangeConnection($truncat


te\Tests\Foundation\Testing\Concerns;

use Illuminate\Foundation\Testing\Concerns\InteractsWithViews;
use Illuminate\Testing\TestComponent;
use Illuminate\View\Component;
use Orchestra\Testbench\TestCase;

class InteractsWithViewsTest extends TestCase
{
    use InteractsWithViews;

    public function testBladeCorrectlyRendersString()
    {
        $string = (string) $this->blade('@if(true)test @endif');

        $this->assertSame('test ', $string);
    }

    public function testComponentCanAccessPublicPro

ic function render()
            {
                return 'rendered content';
            }
        };

        $component = $this->component(get_class($exampleComponent));

        $this->assertSame('bar', $component->foo);
        $this->assertSame('hell

perties()
    {
        $exampleComponent = new class extends Component
        {
            public $foo = 'bar';

            public function speak()
            {
                return 'hello';
            }

            publ


Illuminate\Foundation\Testing\Concerns\InteractsWithTime;
use Illuminate\Support\Carbon;
use PHPUnit\Framework\TestCase;

class FoundationInteractsWithTimeTest extends TestCase
{
    use InteractsWithTime;

    protected function tearDown(): void
    {
        Carbon::setTestNow();

        parent::tearDown();
    }

    public function testFreezeTimeReturnsFrozenTime()
    {
        $actual = $this->freezeTime();

        $this->assertTrue(Carbon::hasTestNow());
        $this->assertInstanceOf(\DateTimeInt

345;
        });

        $this->assertSame(12345, $actual);
        $this->assertFalse(Carbon::hasTestNow());
    }

    public function testFreezeTimeReturnsCallbackResultEvenWhenNull()
    {
        $actual = $this->freezeTime(function () {

erface::class, $actual);
        $this->assertTrue(Carbon::getTestNow()->eq($actual));
    }

    public function testFreezeTimeReturnsCallbackResult()
    {
        $actual = $this->freezeTime(function () {
            return 12


urces/js/app.js'], $buildDir);

        $this->assertStringEndsWith(
            '<link rel="stylesheet" href="https://example.com/'.$buildDir.'/assets/layout.versioned.css" />'
            .'<link rel="stylesheet" href="https://example.com/'.$buildDir.'/assets/header.versioned.css" />'
            .'<script type="module" src="https://example.com/'.$buildDir.'/assets/app.versioned.js"></script>',
            $result->toHtml()
        );

        $this->cleanViteManifest($buildDir);
    }

    public functio

000/@vite/client"></script>'
            .'<script type="module" src="http://localhost:3000/resources/js/app.js"></script>',
            $result->toHtml()
        );
    }

    public function testViteHotModuleReplacementWithJsAndCss()
    {
        $this-

n testViteHotModuleReplacementWithJsOnly()
    {
        $this->makeViteHotFile();

        $result = app(Vite::class)('resources/js/app.js');

        $this->assertSame(
            '<script type="module" src="http://localhost:3


ork\TestCase;

class PaginatorTest extends TestCase
{
    public function testSimplePaginatorReturnsRelevantContextInformation()
    {
        /** @var Paginator<int, string> $p */
        $p = new Paginator(['item3', 'item4', 'item5'], 2, 2);

        $this->assertEquals(2, $p->currentPage());
        $this->assertTrue($p->hasPages());
        $this->assertTrue($p->hasMorePages());
        $this->assertEquals(['item3', 'item4'], $p->items());

        $pageInfo = [
            'per_page' => 2,

     'to' => 4,
            'data' => ['item3', 'item4'],
            'path' => '/',
        ];

        $this->assertEquals($pageInfo, $p->toArray());
    }

    public function testPaginatorRemovesTrailingSlashes()
    {
        $p = new Paginator(['item

'current_page' => 2,
            'first_page_url' => '/?page=1',
            'current_page_url' => '/?page=2',
            'next_page_url' => '/?page=3',
            'prev_page_url' => '/?page=1',
            'from' => 3,


Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Pagination\UrlWindow;
use PHPUnit\Framework\TestCase;

class UrlWindowTest extends TestCase
{
    public function testPresenterCanDetermineIfThereAreAnyPagesToShow()
    {
        $p = new LengthAwarePaginator($array = ['item1', 'item2', 'item3', 'item4'], 4, 2, 2);
        $window = new UrlWindow($p);
        $this->assertTrue($window->hasPages());
    }

    public function testPresenterCanGetAUrlRangeForASmallNumberOfUrls()
    {
        $p = new

indow->get());
    }

    public function testPresenterCanGetAUrlRangeForAWindowOfLinks()
    {
        $array = [];
        for ($i = 1; $i <= 20; $i++) {
            $array[$i] = 'item'.$i;
        }
        $p = new LengthAwarePaginator($array, count($a

 LengthAwarePaginator($array = ['item1', 'item2', 'item3', 'item4'], 4, 2, 2);
        $window = new UrlWindow($p);
        $this->assertEquals(['first' => [1 => '/?page=1', 2 => '/?page=2'], 'slider' => null, 'last' => null], $w


Illuminate\JsonSchema\JsonSchema;
use PHPUnit\Framework\TestCase;

class ArrayTypeTest extends TestCase
{
    public function test_it_may_set_min_items(): void
    {
        $type = JsonSchema::array()->title('Tags')->min(1);

        $this->assertEquals([
            'type' => 'array',
            'title' => 'Tags',
            'minItems' => 1,
        ], $type->toArray());
    }

    public function test_it_may_set_max_items(): void
    {
        $type = JsonSchema::array()->description('A list of tags')-

ype(): void
    {
        $type = JsonSchema::array()->items(
            JsonSchema::string()->max(20)
        );

        $this->assertEquals([
            'type' => 'array',
            'items' => [
                'type' => 'string',
                'm

>max(10);

        $this->assertEquals([
            'type' => 'array',
            'description' => 'A list of tags',
            'maxItems' => 10,
        ], $type->toArray());
    }

    public function test_it_may_set_items_t


pace Illuminate\Tests\JsonSchema;

use Illuminate\JsonSchema\JsonSchema;
use PHPUnit\Framework\TestCase;

class BooleanTypeTest extends TestCase
{
    public function test_serializes_as_boolean_with_metadata(): void
    {
        $type = JsonSchema::boolean()->title('Enabled')->description('Feature flag');

        $this->assertEquals([
            'type' => 'boolean',
            'title' => 'Enabled',
            'description' => 'Feature flag',
        ], $type->toArray());
    }

    public function test

  }

    public function test_may_set_default_false_via_default(): void
    {
        $type = JsonSchema::boolean()->default(false);

        $this->assertEquals([
            'type' => 'boolean',
            'default' => false,
        ], $type->toArray()

_may_set_default_true_via_default(): void
    {
        $type = JsonSchema::boolean()->default(true);

        $this->assertEquals([
            'type' => 'boolean',
            'default' => true,
        ], $type->toArray());


te\Tests\JsonSchema;

use Illuminate\JsonSchema\JsonSchema;
use PHPUnit\Framework\TestCase;

class IntegerTypeTest extends TestCase
{
    public function test_it_may_set_min_value(): void
    {
        $type = JsonSchema::integer()->title('Age')->min(5);

        $this->assertEquals([
            'type' => 'integer',
            'title' => 'Age',
            'minimum' => 5,
        ], $type->toArray());
    }

    public function test_it_may_set_max_value(): void
    {
        $type = JsonSchema::integer()-

it_may_set_default_value(): void
    {
        $type = JsonSchema::integer()->default(18);

        $this->assertEquals([
            'type' => 'integer',
            'default' => 18,
        ], $type->toArray());
    }

    public function test_it_may_set

>description('Max age')->max(10);

        $this->assertEquals([
            'type' => 'integer',
            'description' => 'Max age',
            'maximum' => 10,
        ], $type->toArray());
    }

    public function test_


Illuminate\JsonSchema\JsonSchema;
use PHPUnit\Framework\TestCase;

class NumberTypeTest extends TestCase
{
    public function test_it_may_set_min_value_as_float(): void
    {
        $type = JsonSchema::number()->title('Price')->min(5.5);

        $this->assertEquals([
            'type' => 'number',
            'title' => 'Price',
            'minimum' => 5.5,
        ], $type->toArray());
    }

    public function test_it_may_set_min_value_as_int(): void
    {
        $type = JsonSchema::number()->title

loat(): void
    {
        $type = JsonSchema::number()->description('Max price')->max(10.75);

        $this->assertEquals([
            'type' => 'number',
            'description' => 'Max price',
            'maximum' => 10.75,
        ], $type->toArra

('Price')->min(5);

        $this->assertEquals([
            'type' => 'number',
            'title' => 'Price',
            'minimum' => 5,
        ], $type->toArray());
    }

    public function test_it_may_set_max_value_as_f


onSchema\JsonSchemaTypeFactory;
use PHPUnit\Framework\TestCase;

class ObjectTypeTest extends TestCase
{
    public function test_it_may_not_have_properties(): void
    {
        $type = JsonSchema::object()->title('Payload');

        $this->assertEquals([
            'type' => 'object',
            'title' => 'Payload',
        ], $type->toArray());
    }

    public function test_it_may_be_initialized_with_a_closure_but_without_properties(): void
    {
        $type = JsonSchema::object(fn () => [])->tit

onSchema::object([
            'age-a' => JsonSchema::integer()->min(0)->required(),
            'age-b' => JsonSchema::integer()->default(30)->max(45),
        ])->description('Root object');

        $this->assertEquals([
            'type' => 'object',

le('Payload');

        $this->assertEquals([
            'type' => 'object',
            'title' => 'Payload',
        ], $type->toArray());
    }

    public function test_it_may_have_properties(): void
    {
        $type = Js


te\Tests\JsonSchema;

use Illuminate\JsonSchema\Types\StringType;
use PHPUnit\Framework\TestCase;

class StringTypeTest extends TestCase
{
    public function test_it_sets_min_length()
    {
        $type = (new StringType)->min(5);

        $this->assertEquals([
            'type' => 'string',
            'minLength' => 5,
        ], $type->toArray());
    }

    public function test_it_sets_max_length()
    {
        $type = (new StringType)->description('User handle')->max(10);

        $this->assertEqua

)->default('foo')->pattern('^foo.*$');

        $this->assertEquals([
            'type' => 'string',
            'default' => 'foo',
            'pattern' => '^foo.*$',
        ], $type->toArray());
    }

    public function test_it_sets_format()
    {

ls([
            'type' => 'string',
            'description' => 'User handle',
            'maxLength' => 10,
        ], $type->toArray());
    }

    public function test_it_sets_pattern()
    {
        $type = (new StringType


        $this->assertEquals([
            'type' => 'object',
            'title' => 'User',
            'description' => 'User payload',
            'default' => ['age' => 20],
            'properties' => [
                'age' => [
                    'type' => 'integer',
                    'minimum' => 0,
                ],
            ],
            'required' => ['age'],
        ], $type->toArray());
    }

    public function test_does_have_a_string_representation(): void
    {
        $type = JsonS

ge": {
                    "minimum": 0,
                    "type": "integer"
                }
            },
            "type": "object",
            "required": [
                "age"
            ]
        }
        JSON, $type->toString());
    }

chema::object([
            'age' => JsonSchema::integer()->min(0)->required(),
        ])->title('User');

        $this->assertSame(<<<'JSON'
        {
            "title": "User",
            "properties": {
                "a


me
    |--------------------------------------------------------------------------
    |
    | This value is the name of your application, which will be used when the
    | framework needs to place the application's name in a notification or
    | other UI elements where an application name needs to be displayed.
    |
    */

    'name' => env('APP_NAME', 'Laravel'),

    /*
    |--------------------------------------------------------------------------
    | Application Environment
    |------------------

--------------------------------------------------------
    |
    | This value determines the "environment" your application is currently
    | running in. This may determine how you prefer to configure various
    | services th


-
    | Authentication Defaults
    |--------------------------------------------------------------------------
    |
    | This option defines the default authentication "guard" and password
    | reset "broker" for your application. You may change these values
    | as required, but they're a perfect start for most applications.
    |
    */

    'defaults' => [
        'guard' => env('AUTH_GUARD', 'web'),
        'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
    ],

    /*
    |-------------------

our application.
    | Of course, a great default configuration has been defined for you
    | which utilizes session storage plus the Eloquent user provider.
    |
    | All authentication guards have a user provider, which defines how the
    | users are


----------------------------------------------------
    | Default Broadcaster
    |--------------------------------------------------------------------------
    |
    | This option controls the default broadcaster that will be used by the
    | framework when an event needs to be broadcast. You may set this to
    | any of the connections defined in the "connections" array below.
    |
    | Supported: "reverb", "pusher", "ably", "redis", "log", "null"
    |
    */

    'default' => env('BROADCAST_CONNECT

ou may define all of the broadcast connections that will be used
    | to broadcast events to other systems or over WebSockets. Samples of
    | each available type of connection are provided inside this array.
    |
    */

    'connections' => [


------------------------------
    | Default Cache Store
    |--------------------------------------------------------------------------
    |
    | This option controls the default cache store that will be used by the
    | framework. This connection is utilized if another isn't explicitly
    | specified when running a cache operation inside the application.
    |
    */

    'default' => env('CACHE_STORE', 'database'),

    /*
    |-------------------------------------------------------------------------

ne multiple stores for the
    | same cache driver to group types of items stored in your caches.
    |
    | Supported drivers: "array", "database", "file", "memcached",
    |                    "redis", "dynamodb", "storage", "octane",
    |

-
    | Cache Stores
    |--------------------------------------------------------------------------
    |
    | Here you may define all of the cache "stores" for your application as
    | well as their drivers. You may even defi


    |--------------------------------------------------------------------------
    | Cross-Origin Resource Sharing (CORS) Configuration
    |--------------------------------------------------------------------------
    |
    | Here you may configure your settings for cross-origin resource sharing
    | or "CORS". This determines what cross-origin operations may execute
    | in web browsers. You are free to adjust these settings as needed.
    |
    | To learn more: https://developer.mozilla.org/en-US/do

*', 'sanctum/csrf-cookie'],

    'allowed_methods' => ['*'],

    'allowed_origins' => ['*'],

    'allowed_origins_patterns' => [],

    'allowed_headers' => ['*'],

    'exposed_headers' => [],

    'max_age' => 0,

    'supports_credentials' => false,

cs/Web/HTTP/CORS
    |
    */

    'paths' => ['api/


--------------------------------------------------------------
    |
    | Here you may specify which of the database connections below you wish
    | to use as your default connection for database operations. This is
    | the connection which will be utilized unless another connection
    | is explicitly specified when you execute a query / statement.
    |
    */

    'default' => env('DB_CONNECTION', 'sqlite'),

    /*
    |--------------------------------------------------------------------------
    |

for each database system which
    | is supported by Laravel. You're free to add / remove connections.
    |
    */

    'connections' => [

        'sqlite' => [
            'driver' => 'sqlite',
            'url' => env('DB_URL'),
            'database'

 Database Connections
    |--------------------------------------------------------------------------
    |
    | Below are all of the database connections defined for your application.
    | An example configuration is provided


----------------------------------------------------
    | Default Filesystem Disk
    |--------------------------------------------------------------------------
    |
    | Here you may specify the default filesystem disk that should be used
    | by the framework. The "local" disk, as well as a variety of cloud
    | based disks are available to your application for file storage.
    |
    */

    'default' => env('FILESYSTEM_DISK', 'local'),

    /*
    |-------------------------------------------------

nfigure multiple disks for the same driver. Examples for
    | most supported storage drivers are configured here for reference.
    |
    | Supported drivers: "local", "ftp", "sftp", "s3"
    |
    */

    'disks' => [

        'local' => [
            'd


----------------------------------------------------
    | Default Hash Driver
    |--------------------------------------------------------------------------
    |
    | This option controls the default hash driver that will be used to hash
    | passwords for your application. By default, the bcrypt algorithm is
    | used; however, you remain free to modify this option if you wish.
    |
    | Supported: "bcrypt", "argon", "argon2id"
    |
    */

    'driver' => env('HASH_DRIVER', 'bcrypt'),

    /*

options that should be used when
    | passwords are hashed using the Bcrypt algorithm. This will allow you
    | to control the amount of time it takes to hash the given password.
    |
    */

    'bcrypt' => [
        'rounds' => env('BCRYPT_ROUNDS', 12


dpHandler;
use Monolog\Processor\PsrLogMessageProcessor;

return [

    /*
    |--------------------------------------------------------------------------
    | Default Log Channel
    |--------------------------------------------------------------------------
    |
    | This option defines the default log channel that is utilized to write
    | messages to your logs. The value provided here should match one of
    | the channels present in the list of "channels" configured below.
    |
    */

    'defaul

----
    |
    | This option controls the log channel that should be used to log warnings
    | regarding deprecated PHP and library features. This allows you to get
    | your application ready for upcoming major versions of dependencies.
    |
    */


-
    | Default Mailer
    |--------------------------------------------------------------------------
    |
    | This option controls the default mailer that is used to send all email
    | messages unless another mailer is explicitly specified when sending
    | the message. All additional mailers can be configured within the
    | "mailers" array. Examples of each type of mailer are provided.
    |
    */

    'default' => env('MAIL_MAILER', 'log'),

    /*
    |-----------------------------------------

 | their respective settings. Several examples have been configured for
    | you and you are free to add your own as your application requires.
    |
    | Laravel supports a variety of mail "transport" drivers that can be used
    | when delivering an em


-
    | Default Queue Connection Name
    |--------------------------------------------------------------------------
    |
    | Laravel's queue supports a variety of backends via a single, unified
    | API, giving you convenient access to each backend using identical
    | syntax for each. The default queue connection is defined below.
    |
    */

    'default' => env('QUEUE_CONNECTION', 'database'),

    /*
    |--------------------------------------------------------------------------
    | Queue Con

s provided for
    | each backend supported by Laravel. You're also free to add more.
    |
    | Drivers: "sync", "database", "beanstalkd", "sqs", "redis",
    |          "deferred", "failover", "null"
    |
    */

    'connections' => [

        'sync'

nections
    |--------------------------------------------------------------------------
    |
    | Here you may configure the connection options for every queue backend
    | used by your application. An example configuration i


?php

return [

    /*
    |--------------------------------------------------------------------------
    | Third Party Services
    |--------------------------------------------------------------------------
    |
    | This file is for storing the credentials for third party services such
    | as Mailgun, Postmark, AWS and more. This file provides the de facto
    | location for this type of information, allowing packages to have
    | a conventional file to locate the various service credentials.
    |

ECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
    ],

    'slack' => [
        'notifications' => [
            'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
            'channel' => env('SLACK_BOT_USER_DEFA

    */

    'postmark' => [
        'token' => env('POSTMARK_TOKEN'),
    ],

    'resend' => [
        'key' => env('RESEND_KEY'),
    ],

    'ses' => [
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_S


-------------------------------------
    |
    | This option determines the default session driver that is utilized for
    | incoming requests. Laravel supports a variety of storage options to
    | persist session data. Database storage is a great default choice.
    |
    | Supported: "file", "cookie", "database", "memcached",
    |            "redis", "dynamodb", "array"
    |
    */

    'driver' => env('SESSION_DRIVER', 'database'),

    /*
    |-------------------------------------------------------

main idle before it expires. If you want them
    | to expire immediately when the browser is closed then you may
    | indicate that via the expire_on_close configuration option.
    |
    */

    'lifetime' => (int) env('SESSION_LIFETIME', 120),

    'ex


?php

return [

    /*
    |--------------------------------------------------------------------------
    | View Storage Paths
    |--------------------------------------------------------------------------
    |
    | Most templating systems load templates from disk. Here you may specify
    | an array of paths that should be checked for your views. Of course
    | the usual Laravel view path has already been registered for you.
    |
    */

    'paths' => [
        resource_path('views'),
    ],

    /*

l the compiled Blade templates will be
    | stored for your application. Typically, this is within the storage
    | directory. However, as usual, you are free to change this value.
    |
    */

    'compiled' => env(
        'VIEW_COMPILED_PATH',


te\Tests\Pagination;

use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Pagination\CursorPaginator;
use Illuminate\Tests\Pagination\Fixtures\Models\CursorResourceTestModel;
use PHPUnit\Framework\TestCase;

class CursorResourceTest extends TestCase
{
    public function testItCanTransformToExplicitResource()
    {
        $paginator = new CursorResourceTestPaginator([
            new CursorResourceTestModel(),
        ], 1);

        $resource = $paginator->toResourceCollection(CursorResourceTe

   $this->expectExceptionMessage('Failed to find resource class for model [Illuminate\Tests\Pagination\Fixtures\Models\CursorResourceTestModel].');

        $paginator = new CursorResourceTestPaginator([
            new CursorResourceTestModel(),
        ]

stResource::class);

        $this->assertInstanceOf(JsonResource::class, $resource);
    }

    public function testItThrowsExceptionWhenResourceCannotBeFound()
    {
        $this->expectException(\LogicException::class);


Unit\Framework\TestCase;

class LengthAwarePaginatorTest extends TestCase
{
    /**
     * @var \Illuminate\Pagination\LengthAwarePaginator
     */
    private $p;

    /**
     * @var array
     */
    private $options;

    protected function setUp(): void
    {
        $this->options = ['onEachSide' => 5];
        $this->p = new LengthAwarePaginator($array = ['item1', 'item2', 'item3', 'item4'], 4, 2, 2, $this->options);
    }

    protected function tearDown(): void
    {
        unset($this->p);

this->p->getPageName());
    }

    public function testLengthAwarePaginatorCanGiveMeRelevantPageInformation()
    {
        $this->assertEquals(2, $this->p->lastPage());
        $this->assertEquals(2, $this->p->currentPage());
        $this->assertTrue($t

   parent::tearDown();
    }

    public function testLengthAwarePaginatorGetAndSetPageName()
    {
        $this->assertSame('page', $this->p->getPageName());

        $this->p->setPageName('p');
        $this->assertSame('p', $


te\Tests\Pagination;

use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Tests\Pagination\Fixtures\Models\PaginatorResourceTestModel;
use PHPUnit\Framework\TestCase;

class PaginatorResourceTest extends TestCase
{
    public function testItCanTransformToExplicitResource()
    {
        $paginator = new PaginatorResourceTestPaginator([
            new PaginatorResourceTestModel(),
        ], 1, 1, 1);

        $resource = $paginator->toResourceColl

icException::class);
        $this->expectExceptionMessage('Failed to find resource class for model [Illuminate\Tests\Pagination\Fixtures\Models\PaginatorResourceTestModel].');

        $paginator = new PaginatorResourceTestPaginator([
            new Pagi

ection(PaginatorResourceTestResource::class);

        $this->assertInstanceOf(JsonResource::class, $resource);
    }

    public function testItThrowsExceptionWhenResourceCannotBeFound()
    {
        $this->expectException(\Log


<?php

namespace Illuminate\Tests\Foundation\Console;

use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Console\Kernel;
use Illuminate\Foundation\Events\Terminating;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\StringInput;

class KernelTest extends TestCase
{
    public function testItDispatchesTerminatingEvent()
    {
        $called = [];
        $app = new Application;
        $events = new Dispatcher($app);
        $app->instance(

tion () use (&$called) {
            $called[] = 'terminating callback';
        });

        $kernel->terminate(new StringInput('tinker'), 0);

        $this->assertSame([
            'terminating event',
            'terminating callback',
        ], $ca

'events', $events);
        $kernel = new Kernel($app, $events);
        $events->listen(function (Terminating $terminating) use (&$called) {
            $called[] = 'terminating event';
        });
        $app->terminating(func


re\TransformsRequest;
use Illuminate\Http\Request;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;

class TransformsRequestTest extends TestCase
{
    public function testTransformOncePerKeyWhenMethodIsGet()
    {
        $middleware = new TruncateInput;
        $symfonyRequest = new SymfonyRequest([
            'bar' => '123',
            'baz' => 'abc',
        ]);
        $symfonyRequest->server->set('REQUEST_METHOD', 'GET');
        $request = Request::cre

    }

    public function testTransformOncePerKeyWhenMethodIsPost()
    {
        $middleware = new ManipulateInput;
        $symfonyRequest = new SymfonyRequest(
            [
                'name' => 'Damian',
                'beers' => 4,

ateFromBase($symfonyRequest);

        $middleware->handle($request, function (Request $request) {
            $this->assertSame('12', $request->get('bar'));
            $this->assertSame('ab', $request->get('baz'));
        });


iddleware;

use Illuminate\Foundation\Http\Middleware\TrimStrings;
use Illuminate\Http\Request;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;

class TrimStringsTest extends TestCase
{
    public function testTrimStringsIgnoringExceptAttribute()
    {
        $middleware = new TrimStringsWithExceptAttribute;
        $symfonyRequest = new SymfonyRequest([
            'abc' => '  123  ',
            'xyz' => '  456  ',
            'foo' => '  789  ',

          $this->assertSame('123', $request->get('abc'));
            $this->assertSame('456', $request->get('xyz'));
            $this->assertSame('  789  ', $request->get('foo'));
            $this->assertSame('  010  ', $request->get('bar'));
        })

  'bar' => '  010  ',
        ]);
        $symfonyRequest->server->set('REQUEST_METHOD', 'GET');
        $request = Request::createFromBase($symfonyRequest);

        $middleware->handle($request, function (Request $request) {


tTrue($results->successful());
    }

    public function testProcessPoolFailed()
    {
        $factory = new Factory;

        $factory->fake([
            'cat *' => $factory->result(exitCode: 1),
        ]);

        $pool = $factory->pool(function ($pool) {
            return [
                $pool->path(__DIR__)->command($this->ls()),
                $pool->path(__DIR__)->command('cat test'),
            ];
        });

        $results = $pool->start()->wait();

        $this->assertTrue($results[0]

actory->pool(function ($pool) {
            return [
                $pool->path(__DIR__)->command($this->ls()),
                $pool->path(__DIR__)->command($this->ls()),
            ];
        })->start();

        $this->assertCount(2, $pool);
    }

->successful());
        $this->assertTrue($results[1]->failed());

        $this->assertTrue($results->failed());
    }

    public function testInvokedProcessPoolCount()
    {
        $factory = new Factory;

        $pool = $f


pace Illuminate\Tests\Cookie\Middleware;

use Illuminate\Cookie\CookieJar;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;

class AddQueuedCookiesToResponseTest extends TestCase
{
    public function testHandle(): void
    {
        $cookieJar = new CookieJar;
        $cookieOne = $cookieJar->make('foo', 'bar', 0, '/path');
        $cookieTwo = $cook

(Request $request) {
            return new Response;
        };
        $this->assertEquals(
            [
                '' => [
                    '/path' => [
                        'foo' => $cookieOne,
                    ],
                    '/'

ieJar->make('foo', 'rab', 0, '/');
        $cookieJar->queue($cookieOne);
        $cookieJar->queue($cookieTwo);
        $addQueueCookiesToResponseMiddleware = new AddQueuedCookiesToResponse($cookieJar);
        $next = function


e\Cookie\CookieValuePrefix;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Encryption\Encrypter;
use Illuminate\Events\Dispatcher;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
use Illuminate\Routing\Router;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Cookie;

class EncryptCookiesTest extends TestCase
{
    /**
     * @var \Illuminate\Container\Container

etUp(): void
    {
        parent::setUp();

        $this->container = new Container;
        $this->container->singleton(EncrypterContract::class, function () {
            return new Encrypter(str_repeat('a', 16));
        });

        $this->router = n

 */
    protected $container;

    /**
     * @var \Illuminate\Routing\Router
     */
    protected $router;

    protected $setCookiePath = 'cookie/set';
    protected $queueCookiePath = 'cookie/queue';

    protected function s


ception;
use Illuminate\Database\Events\TransactionBeginning;
use Illuminate\Database\Events\TransactionCommitted;
use Illuminate\Database\Events\TransactionRolledBack;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Pipeline;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;

class PipelineTransactionTest extends TestCase
{
    public function testPipelineTransaction()
    {
        Event::fake();

        $result = Pipeline::withinTransaction()

e string', $result);
        Event::assertDispatchedTimes(TransactionBeginning::class, 1);
        Event::assertDispatchedTimes(TransactionCommitted::class, 1);
    }

    public static function transactionConnectionDataProvider(): array
    {
        retu

   ->send('some string')
            ->through([
                fn ($value, $next) => $next($value),
                fn ($value, $next) => $next($value),
            ])
            ->thenReturn();

        $this->assertSame('som


minate\Container\Container;
use Illuminate\Events\Dispatcher;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class EventsSubscriberTest extends TestCase
{
    public function testEventSubscribers()
    {
        $this->expectNotToPerformAssertions();

        $d = new Dispatcher($container = m::mock(Container::class));
        $subs = m::mock(ExampleSubscriber::class);
        $subs->shouldReceive('subscribe')->once()->with($d);
        $container->shouldReceive('make')->once()->with(ExampleSubscriber::

 $subs = m::mock(ExampleSubscriber::class);
        $subs->shouldReceive('subscribe')->once()->with($d);

        $d->subscribe($subs);
    }

    public function testEventSubscribeCanReturnMappings()
    {
        $d = new Dispatcher;
        $d->subscrib

class)->andReturn($subs);

        $d->subscribe(ExampleSubscriber::class);
    }

    public function testEventSubscribeCanAcceptObject()
    {
        $this->expectNotToPerformAssertions();

        $d = new Dispatcher;


minate\Contracts\Events\Dispatcher;
use Illuminate\Notifications\Channels\BroadcastChannel;
use Illuminate\Notifications\Events\BroadcastNotificationCreated;
use Illuminate\Notifications\Messages\BroadcastMessage;
use Illuminate\Notifications\Notification;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class NotificationBroadcastChannelTest extends TestCase
{
    public function testDatabaseChannelCreatesDatabaseRecordWithProperData()
    {
        $notification = new NotificationBroadcastChannelTestNot

     $channel = new BroadcastChannel($events);
        $channel->send($notifiable, $notification);
    }

    public function testNotificationIsBroadcastedOnCustomChannels()
    {
        $notification = new CustomChannelsTestNotification;
        $notific

ification;
        $notification->id = 1;
        $notifiable = m::mock();

        $events = m::mock(Dispatcher::class);
        $events->shouldReceive('dispatch')->once()->with(m::type(BroadcastNotificationCreated::class));


use Mockery as m;
use PHPUnit\Framework\TestCase;

class NotificationChannelManagerTest extends TestCase
{
    protected function tearDown(): void
    {
        Container::setInstance(null);

        parent::tearDown();
    }

    public function testNotificationCanBeDispatchedToDriver()
    {
        $container = new Container;
        $container->instance('config', ['app.name' => 'Name', 'app.logo' => 'Logo']);
        $container->instance(Bus::class, $bus = m::mock());
        $container->instance(Dispat

        $events->shouldReceive('listen')->once();
        $events->shouldReceive('until')->with(m::type(NotificationSending::class))->andReturn(true);
        $driver->shouldReceive('send')->once();
        $events->shouldReceive('dispatch')->with(m::type

cher::class, $events = m::mock());
        Container::setInstance($container);
        $manager = m::mock(ChannelManager::class.'[driver]', [$container]);
        $manager->shouldReceive('driver')->andReturn($driver = m::mock());


se Illuminate\Notifications\Channels\DatabaseChannel;
use Illuminate\Notifications\Messages\DatabaseMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Carbon;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class NotificationDatabaseChannelTest extends TestCase
{
    public function testDatabaseChannelCreatesDatabaseRecordWithProperData()
    {
        $notification = new NotificationDatabaseChannelTestNotification;
        $notification->id = 1;
        $notifiable = m::mock();

);

        $channel = new DatabaseChannel;
        $channel->send($notifiable, $notification);
    }

    public function testCorrectPayloadIsSentToDatabase()
    {
        $notification = new NotificationDatabaseChannelTestNotification;
        $notifica

        $notifiable->shouldReceive('routeNotificationFor->create')->with([
            'id' => 1,
            'type' => get_class($notification),
            'data' => ['invoice_id' => 1],
            'read_at' => null,
        ]


se Illuminate\Container\Container;
use Illuminate\Contracts\Notifications\Dispatcher;
use Illuminate\Notifications\RoutesNotifications;
use Illuminate\Support\Facades\Notification;
use InvalidArgumentException;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use stdClass;

class NotificationRoutesNotificationsTest extends TestCase
{
    protected function tearDown(): void
    {
        Container::setInstance(null);

        parent::tearDown();
    }

    public function testNotificationCanBeDispatched()

 stdClass;
        $factory->shouldReceive('send')->with($notifiable, $instance);
        Container::setInstance($container);

        $notifiable->notify($instance);
    }

    public function testNotificationCanBeSentNow()
    {
        $container = new

   {
        $container = new Container;
        $factory = m::mock(Dispatcher::class);
        $container->instance(Dispatcher::class, $factory);
        $notifiable = new RoutesNotificationsTestInstance;
        $instance = new


se Illuminate\Contracts\Database\ModelIdentifier;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\AnonymousNotifiable;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Notifications\Notifiable;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\SendQueuedNotifications;
use Illuminate\Support\Collection;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class NotificationSendQueuedNotificationTest extends TestCase
{
    public function testNotificationsCa

->once()->withArgs(function ($notifiables, $notification, $channels) {
            return $notifiables instanceof Collection && $notifiables->toArray() === ['notifiables']
                && $notification instanceof TestNotification
                && $cha

nBeSent()
    {
        $notification = new TestNotification;
        $job = new SendQueuedNotifications('notifiables', $notification);
        $manager = m::mock(ChannelManager::class);
        $manager->shouldReceive('sendNow')


PaginatorTest extends TestCase
{
    public function testReturnsRelevantContextInformation()
    {
        $p = new CursorPaginator($array = [['id' => 1], ['id' => 2], ['id' => 3]], 2, null, [
            'parameters' => ['id'],
        ]);

        $this->assertTrue($p->hasPages());
        $this->assertTrue($p->hasMorePages());
        $this->assertEquals([['id' => 1], ['id' => 2]], $p->items());

        $pageInfo = [
            'data' => [['id' => 1], ['id' => 2]],
            'path' => '/',

    ];

        $this->assertEquals($pageInfo, $p->toArray());
    }

    public function testPaginatorRemovesTrailingSlashes()
    {
        $p = new CursorPaginator($array = [['id' => 4], ['id' => 5], ['id' => 6]], 2, null,
            ['path' => 'http:/

  'per_page' => 2,
            'next_cursor' => $this->getCursor(['id' => 2]),
            'next_page_url' => '/?cursor='.$this->getCursor(['id' => 2]),
            'prev_cursor' => null,
            'prev_page_url' => null,


te\Tests\Pagination;

use Illuminate\Pagination\Cursor;
use Illuminate\Support\Carbon;
use PHPUnit\Framework\TestCase;

class CursorTest extends TestCase
{
    public function testCanEncodeAndDecodeSuccessfully()
    {
        $cursor = new Cursor([
            'id' => 422,
            'created_at' => Carbon::now()->toDateTimeString(),
        ], true);

        $this->assertEquals($cursor, Cursor::fromEncoded($cursor->encode()));
    }

    public function testFromEncodedReturnsNullForNonStringInput()

d(base64_encode('not-json')));
    }

    public function testFromEncodedReturnsNullWhenDecodedPayloadIsNotAnArray()
    {
        $this->assertNull(Cursor::fromEncoded(base64_encode(json_encode('scalar'))));
        $this->assertNull(Cursor::fromEncoded(b

{
        $this->assertNull(Cursor::fromEncoded(null));
        $this->assertNull(Cursor::fromEncoded(123));
    }

    public function testFromEncodedReturnsNullForInvalidJson()
    {
        $this->assertNull(Cursor::fromEncode


te\Tests\Foundation\Http\Middleware;

use Illuminate\Http\Exceptions\MalformedUrlException;
use Illuminate\Http\Middleware\ValidatePathEncoding;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use PHPUnit\Framework\Attributes\TestWith;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;

class ValidatePathEncodingTest extends TestCase
{
    #[TestWith(['/'])]
    #[TestWith(['valid-path'])]
    #[TestWith(['ä'])]
    #[TestWith(['with%20space'])]
    #[

     $symfonyRequest->server->set('REQUEST_METHOD', 'GET');
        $symfonyRequest->server->set('REQUEST_URI', $path);
        $request = Request::createFromBase($symfonyRequest);

        $response = $middleware->handle($request, fn () => new Response('O

TestWith(['%E6%B1%89%E5%AD%97%E5%AD%97%E7%AC%A6%E9%9B%86'])]
    public function testValidPathsArePassing(string $path): void
    {
        $middleware = new ValidatePathEncoding;
        $symfonyRequest = new SymfonyRequest;


($piped);
        };

        $result = (new Pipeline(new Container))
            ->send('foo')
            ->through([PipelineTestPipeOne::class, $pipeTwo])
            ->then(function ($piped) {
                return $piped;
            });

        $this->assertSame('foo', $result);
        $this->assertSame('foo', $_SERVER['__test.pipe.one']);
        $this->assertSame('foo', $_SERVER['__test.pipe.two']);

        unset($_SERVER['__test.pipe.one'], $_SERVER['__test.pipe.two']);
    }

    public functi

ed;
            });

        $this->assertSame('foo', $result);
        $this->assertSame('foo', $_SERVER['__test.pipe.one']);

        unset($_SERVER['__test.pipe.one']);
    }

    public function testPipelineUsageWithInvokableObjects()
    {
        $re

on testPipelineUsageWithObjects()
    {
        $result = (new Pipeline(new Container))
            ->send('foo')
            ->through([new PipelineTestPipeOne])
            ->then(function ($piped) {
                return $pip


']);
        $this->assertSame('barbar', $_SERVER['__event.test']);
    }

    public function testDeferEventExecution()
    {
        unset($_SERVER['__event.test']);
        $d = new Dispatcher;
        $d->listen('foo', function ($foo) {
            $_SERVER['__event.test'] = $foo;
        });

        $result = $d->defer(function () use ($d) {
            $d->dispatch('foo', ['bar']);
            $this->assertArrayNotHasKey('__event.test', $_SERVER);

            return 'callback_result';
        });

Dispatcher;
        $d->listen('foo', function ($value) {
            $_SERVER['__event.test'][] = $value;
        });
        $d->listen('bar', function ($value) {
            $_SERVER['__event.test'][] = $value;
        });
        $d->defer(function ()

       $this->assertSame('callback_result', $result);
        $this->assertSame('bar', $_SERVER['__event.test']);
    }

    public function testDeferMultipleEvents()
    {
        $_SERVER['__event.test'] = [];
        $d = new


e;

use Illuminate\Foundation\Console\ServeCommand;
use PHPUnit\Framework\TestCase;

class ServeCommandLogParserTest extends TestCase
{
    public function testExtractRequestPortWithValidLogLine()
    {
        $line = '[Mon Nov 19 10:30:45 2024] :8080 Info';

        $this->assertEquals(8080, ServeCommand::getRequestPortFromLine($line));
    }

    public function testExtractRequestPortWithValidLogLineAndExtraData()
    {
        $line = '[Mon Nov 19 10:30:45 2024] :3000 [Client Connected]';

        $this

ServeCommand::getRequestPortFromLine($line));
    }

    public function testExtractRequestPortWithMissingPort()
    {
        $line = '[Mon Nov 19 10:30:45 2024] Info';

        $this->expectException(\InvalidArgumentException::class);
        $this->expe

->assertEquals(3000, ServeCommand::getRequestPortFromLine($line));
    }

    public function testExtractRequestPortWithValidLogLineWithoutDate()
    {
        $line = ':5000 [Server Started]';

        $this->assertEquals(5000,


ications\Messages\SimpleMessage as Message;
use PHPUnit\Framework\TestCase;

class NotificationMessageTest extends TestCase
{
    public function testLevelCanBeRetrieved()
    {
        $message = new Message;
        $this->assertSame('info', $message->level);

        $message = new Message;
        $message->level('error');
        $this->assertSame('error', $message->level);
    }

    public function testMessageFormatsMultiLineText()
    {
        $message = new Message;
        $message->with('

     ');

        $this->assertSame('This is a single line of text.', $message->introLines[0]);

        $message = new Message;
        $message->with([
            'This is a',
            'single line of text.',
        ]);

        $this->assertSame('T

      This is a
            single line of text.


HttpClient\ResponseInterface;

class NotificationSenderTest extends TestCase
{
    public function test_it_can_send_queued_notifications_with_a_string_via()
    {
        $notifiable = m::mock(Notifiable::class);
        $manager = m::mock(ChannelManager::class);
        $manager->shouldReceive('getContainer')->andReturn(app());
        $manager->shouldReceive('resolveQueueFromQueueRoute')->andReturn(null);
        $manager->shouldReceive('resolveConnectionFromQueueRoute')->andReturn(null);
        $bus = m

 $events);

        $sender->send($notifiable, new DummyQueuedNotificationWithStringVia);
    }

    public function test_it_can_send_queued_notifications_with_an_array_via()
    {
        $notifiable = m::mock(Notifiable::class);
        $manager = m::moc

::mock(BusDispatcher::class);
        $bus->shouldReceive('dispatch');
        $events = m::mock(EventDispatcher::class);
        $events->shouldReceive('listen')->once();

        $sender = new NotificationSender($manager, $bus,


Mix;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;

class FoundationHelpersTest extends TestCase
{
    public function testCache()
    {
        $app = new Application;
        $app['cache'] = $cache = m::mock(CacheRepository::class);

        // 1. cache()
        $this->assertInstanceOf(CacheRepository::class, cache());

ull)->andReturn('bar');
        $this->assertSame('bar', cache('foo'));

        // 4. cache('foo', null);
        $cache->shouldReceive('get')->once()->with('foo', null)->andReturn('bar');
        $this->assertSame('bar', cache('foo', null));

        //

  // 2. cache(['foo' => 'bar'], 1);
        $cache->shouldReceive('put')->once()->with('foo', 'bar', 1);
        cache(['foo' => 'bar'], 1);

        // 3. cache('foo');
        $cache->shouldReceive('get')->once()->with('foo', n


te\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Events\Dispatcher;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class BroadcastedEventsTest extends TestCase
{
    public function testShouldBroadcastSuccess()
    {
        $d = m::mock(Dispatcher::class);

        $d->makePartial()->shouldAllowMockingProtectedMethods();

        $event = new BroadcastEvent;

        $this->assertTrue($d->shouldBroadcast([$event]));

        $event = new AlwaysBroadcastEvent;

        $this->assertTrue($d->sho

broadcast = m::mock(BroadcastFactory::class);
        $broadcast->shouldReceive('queue')->once();
        $container->shouldReceive('make')->once()->with(BroadcastFactory::class)->andReturn($broadcast);

        $d->listen(AlwaysBroadcastEvent::class, func

uldBroadcast([$event]));
    }

    public function testShouldBroadcastAsQueuedAndCallNormalListeners()
    {
        unset($_SERVER['__event.test']);
        $d = new Dispatcher($container = m::mock(Container::class));
        $


age;
use PHPUnit\Framework\TestCase;

class NotificationMailMessageTest extends TestCase
{
    protected ?string $filesystemRoot = null;

    protected function tearDown(): void
    {
        if ($this->filesystemRoot !== null) {
            $this->deleteDirectory($this->filesystemRoot);
            $this->filesystemRoot = null;
        }

        parent::tearDown();
    }

    public function testTemplate()
    {
        $message = new MailMessage;

        $this->assertSame('notifications::email', $messag

       $this->assertNull($message->view);
        $this->assertSame([], $message->viewData);

        $message->view(['notifications::foo', 'notifications::bar'], [
            'foo' => 'bar',
        ]);

        $this->assertSame('notifications::foo', $m

e->markdown);

        $message->template('notifications::foo');

        $this->assertSame('notifications::foo', $message->markdown);
    }

    public function testHtmlAndPlainView()
    {
        $message = new MailMessage;


pace Illuminate\Tests\Foundation\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use Illuminate\Http\Request;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;

class ConvertEmptyStringsToNullTest extends TestCase
{
    public function testConvertsEmptyStringsToNull()
    {
        $middleware = new ConvertEmptyStringsToNull;
        $symfonyRequest = new SymfonyRequest([
            'foo' => 'bar',
            'baz' => '',

rtSame('bar', $request->get('foo'));
            $this->assertNull($request->get('baz'));
        });
    }

    public function testSkipConvertsEmptyStringsToNull()
    {
        $middleware = new ConvertEmptyStringsToNull;
        ConvertEmptyStringsToNu

        ]);
        $symfonyRequest->server->set('REQUEST_METHOD', 'GET');
        $request = Request::createFromBase($symfonyRequest);

        $middleware->handle($request, function (Request $request) {
            $this->asse


use PHPUnit\Framework\TestCase;

class QueuedEventsTest extends TestCase
{
    public function testQueuedEventHandlersAreQueued()
    {
        $d = new Dispatcher;
        $queue = m::mock(Queue::class);

        $queue->shouldReceive('connection')->once()->with(null)->andReturnSelf();

        $queue->shouldReceive('pushOn')->once()->with(null, m::type(CallQueuedListener::class));

        $d->setQueueResolver(function () use ($queue) {
            return $queue;
        });

        $d->listen('some.even

ueue = new QueueFake(new Container);

        $d->setQueueResolver(function () use ($fakeQueue) {
            return $fakeQueue;
        });

        $d->listen('some.event', TestDispatcherConnectionQueuedHandler::class.'@handle');
        $d->dispatch('so

t', TestDispatcherQueuedHandler::class.'@someMethod');
        $d->dispatch('some.event', ['foo', 'bar']);
    }

    public function testCustomizedQueuedEventHandlersAreQueued()
    {
        $d = new Dispatcher;

        $fakeQ


ain('foo', 'bar');
        $c = $cookie->make('color', 'blue', 10, '/path', '/domain', true, false, false, 'lax');
        $this->assertSame('blue', $c->getValue());
        $this->assertFalse($c->isHttpOnly());
        $this->assertTrue($c->isSecure());
        $this->assertSame('/domain', $c->getDomain());
        $this->assertSame('/path', $c->getPath());
        $this->assertSame('lax', $c->getSameSite());

        $c2 = $cookie->forever('color', 'blue', '/path', '/domain', true, false, false, 'strict')

path', $c2->getPath());
        $this->assertSame('strict', $c2->getSameSite());

        $c3 = $cookie->forget('color');
        $this->assertNull($c3->getValue());
        $this->assertTrue($c3->getExpiresTime() < time());
    }

    public function test

;
        $this->assertSame('blue', $c2->getValue());
        $this->assertFalse($c2->isHttpOnly());
        $this->assertTrue($c2->isSecure());
        $this->assertSame('/domain', $c2->getDomain());
        $this->assertSame('/