Skip to content

Commit

Permalink
feat(test) : unit test for Tools
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldinou committed Oct 8, 2024
1 parent dc63e0b commit 2b11ddf
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions Tests/phpunit/Util/Tools.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

/**
* Part of SplTypes package.
*
* (c) Adrien Loyant <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Ducks\Component\SplTypes\Tests\phpunit\Util;

use Ducks\Component\SplTypes\Tests\common\Month;
use Ducks\Component\SplTypes\Util\Tools;
use PHPUnit\Framework\TestCase;

class ToolsTest extends TestCase
{
/**
* Unit test.
*
* @return void
*/
public function test(): void
{
$this->assertTrue(Tools::isSplEnumExists(Month::class));
}

/**
* Test bad instantiation of Tools Helper.
*
* @return void
*
* @covers Tools::__construct()
*/
public function testNew(): void
{
$reflection = new \ReflectionClass(Tools::class);
$constructor = $reflection->getConstructor();

$this->assertInstanceOf(\ReflectionMethod::class, $constructor);
$this->assertFalse($constructor->isPublic());
}
}

0 comments on commit 2b11ddf

Please sign in to comment.