<?php

namespace TestConfig;

use PHPUnit\Framework\TestCase;
use Config\Autoload;
use RuntimeException;

class AutoloadTest extends TestCase
{
    public function testCharger()
    {
        $this->expectException(RuntimeException::class);
        $this->expectExceptionMessage('Config\Autoload is already started');

        Autoload::charger();
        Autoload::charger();
    }

    public function testShutDown()
    {
        Autoload::shutDown();
        Autoload::charger();
        Autoload::shutDown();

        $this->assertNull(Autoload::getInstance());
    }
}

