<?php

namespace Tests\Feature;

use Illuminate\Support\Facades\Log;
use Monolog\Handler\RotatingFileHandler;
use Tests\TestCase;

class TestLoggingTest extends TestCase
{
    public function test_default_test_logger_keeps_diagnostics_out_of_application_logs(): void
    {
        $this->assertSame('testing', config('logging.default'));

        $handlers = Log::driver()->getHandlers();

        $this->assertCount(1, $handlers);
        $this->assertInstanceOf(RotatingFileHandler::class, $handlers[0]);
        $this->assertSame(
            storage_path('logs/testing-'.date('Y-m-d').'.log'),
            $handlers[0]->getUrl(),
        );
    }
}
