mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-29 19:20:18 +02:00
19 lines
446 B
PHP
19 lines
446 B
PHP
<?php
|
|
|
|
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);
|
|
}
|
|
}
|