<?php declare(strict_types=1);

require_once __DIR__ . '/../../src/common/QrbException.php';

use PHPUnit\Framework\TestCase;

final class QrbExceptionTest extends TestCase
{

    public function testWithAdditionalInformationAndToString() : void
    {
        $e = new QrbException("QrbExceptionTest", "localizeKey", "additionalInformation");
        
        $this->assertEquals("QrbExceptionTest", $e->getMessage());        
        $this->assertEquals("localizeKey", $e->getLocalizeKey());        
        $this->assertEquals("additionalInformation", $e->getAdditionalInformation());
        
        echo $e . "\n";
    }

    public function testWithoutAdditionalInformation() : void
    {
        $e = new QrbException("Error", "localizeKey");
        
        $this->assertEquals("Error", $e->getMessage());        
        $this->assertEquals("localizeKey", $e->getLocalizeKey());        
        $this->assertEquals("", $e->getAdditionalInformation());        
    }
}

?>
