DIContainer/tests/unit/d3DicExceptionTest.php

53 lines
1.3 KiB
PHP
Raw Normal View History

2024-05-27 13:41:52 +02:00
<?php
/**
2024-06-15 23:10:49 +02:00
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
2024-05-27 13:41:52 +02:00
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
2024-06-15 23:10:49 +02:00
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
2024-05-27 13:41:52 +02:00
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\DIContainerHandler\tests;
use D3\DIContainerHandler\d3DicException;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
class d3DicExceptionTest extends TestCase
{
/**
* @test
* @return void
* @covers \D3\DIContainerHandler\d3DicException::__construct
*/
public function canConstruct()
{
$previousMessage = 'previousMessage';
$previousCode = 123;
$previous = new InvalidArgumentException($previousMessage, $previousCode);
$exception = new d3DicException($previous);
$this->assertSame(
$previous,
$exception->getPrevious()
);
$this->assertSame(
$previousMessage,
$exception->getMessage()
);
$this->assertSame(
$previousCode,
$exception->getCode()
);
}
2024-06-15 23:10:49 +02:00
}