mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-09 00:16:32 +02:00
PHP7 Singleton und Multiton
This commit is contained in:
@@ -14,23 +14,4 @@ class SingletonTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertInstanceOf('DesignPatterns\Creational\Singleton\Singleton', $firstCall);
|
||||
$this->assertSame($firstCall, $secondCall);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \DesignPatterns\Creational\Singleton\SingletonPatternViolationException
|
||||
*/
|
||||
public function testNoCloneAllowed()
|
||||
{
|
||||
$obj1 = Singleton::getInstance();
|
||||
$obj2 = clone $obj1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \DesignPatterns\Creational\Singleton\SingletonPatternViolationException
|
||||
*/
|
||||
public function testNoSerializationAllowed()
|
||||
{
|
||||
$obj1 = Singleton::getInstance();
|
||||
$serialized = serialize($obj1);
|
||||
unserialize($serialized);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user