mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 16:45:35 +08:00
add singleton trait test
This commit is contained in:
17
tests/ZM/Utils/SingletonTraitTest.php
Normal file
17
tests/ZM/Utils/SingletonTraitTest.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Tests\ZM\Utils;
|
||||||
|
|
||||||
|
use ZM\Utils\SingletonTrait;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
class SingletonTraitTest extends TestCase
|
||||||
|
{
|
||||||
|
public function testGetInstance(): void
|
||||||
|
{
|
||||||
|
$mock = $this->getObjectForTrait(SingletonTrait::class);
|
||||||
|
$this->assertEquals($mock, $mock::getInstance());
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user