<?php

use PHPUnit\Framework\TestCase;
use Tussendoor\Reloadify\Plugin;

class PluginTest extends TestCase
{
    protected function setUp(): void
    {
        // Set up the Plugin class before each test
        Plugin::setup();
    }

    public function testConfigMethodReturnsCorrectValue()
    {
        // Test that the config method returns the correct value
        $this->assertEquals('Reloadify', Plugin::config('plugin.name'));
    }

    public function testHasConfigMethodReturnsTrueForExistingKey()
    {
        // Test that the hasConfig method returns true for an existing key
        $this->assertTrue(Plugin::hasConfig('plugin.name'));
    }

    public function testHasConfigMethodReturnsFalseForNonExistingKey()
    {
        // Test that the hasConfig method returns false for a non-existing key
        $this->assertFalse(Plugin::hasConfig('non.existing.key'));
    }

    public function testConfigMethodCanSetAndGetValue()
    {
        // Test that the config method can set and get a value
        Plugin::config('test.key', 'test value');
        $this->assertEquals('test value', Plugin::config('test.key'));
    }
}
