diff --git a/Tests/Singleton/SingletonTest.php b/Tests/Singleton/SingletonTest.php new file mode 100644 index 0000000..7291f9d --- /dev/null +++ b/Tests/Singleton/SingletonTest.php @@ -0,0 +1,34 @@ +assertInstanceOf('DesignPatterns\Singleton\Singleton', $firstCall); + $secondCall = Singleton::getInstance(); + $this->assertSame($firstCall, $secondCall); + } + + public function testNoConstructor() + { + $obj = Singleton::getInstance(); + + $refl = new \ReflectionObject($obj); + $meth = $refl->getMethod('__construct'); + $this->assertTrue($meth->isPrivate()); + } + +} \ No newline at end of file