toBeInstanceOf(Singleton::class); }); it('is an attribute class', function () { $reflection = new ReflectionClass(Singleton::class); $attributes = $reflection->getAttributes(\Attribute::class); expect($attributes)->toHaveCount(1); }); it('targets class only', function () { $reflection = new ReflectionClass(Singleton::class); $attribute = $reflection->getAttributes(\Attribute::class)[0]; $attributeInstance = $attribute->newInstance(); expect($attributeInstance->flags)->toBe(\Attribute::TARGET_CLASS); }); });