mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-25 22:09:23 +02:00
19 lines
471 B
PHP
19 lines
471 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Creational\Singleton\Tests;
|
|
|
|
use DesignPatterns\Creational\Singleton\Singleton;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class SingletonTest extends TestCase
|
|
{
|
|
public function testUniqueness()
|
|
{
|
|
$firstCall = Singleton::getInstance();
|
|
$secondCall = Singleton::getInstance();
|
|
|
|
$this->assertInstanceOf(Singleton::class, $firstCall);
|
|
$this->assertSame($firstCall, $secondCall);
|
|
}
|
|
}
|