zhamao-framework/tests_old/ZM/Utils/SingletonTraitTest.php

21 lines
368 B
PHP
Raw Normal View History

2022-03-29 18:16:18 +08:00
<?php
declare(strict_types=1);
namespace Tests\ZM\Utils;
use PHPUnit\Framework\TestCase;
2022-03-29 19:48:31 +08:00
use ZM\Utils\SingletonTrait;
2022-03-29 18:16:18 +08:00
2022-03-29 19:48:31 +08:00
/**
* @internal
*/
2022-03-29 18:16:18 +08:00
class SingletonTraitTest extends TestCase
{
public function testGetInstance(): void
{
$mock = $this->getObjectForTrait(SingletonTrait::class);
$this->assertEquals($mock, $mock::getInstance());
}
}