| Conditions | 1 |
| Paths | 1 |
| Total Lines | 6 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Unit\Chekote\NounStore\Singleton; |
||
| 23 | public function testSubsequentCallsToGetInstanceReturnSameInstance(): void |
||
| 24 | { |
||
| 25 | $instance1 = SingletonClass::getInstance(); |
||
| 26 | $instance2 = SingletonClass::getInstance(); |
||
| 27 | |||
| 28 | $this->assertEquals(spl_object_hash($instance1), spl_object_hash($instance2)); |
||
| 29 | } |
||
| 31 |
Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.