feat: CI/CD pipeline setup complete - Ansible playbooks updated, secrets configured, workflow ready
This commit is contained in:
28
tests/Unit/Framework/Attributes/SingletonTest.php
Normal file
28
tests/Unit/Framework/Attributes/SingletonTest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Framework\Attributes\Singleton;
|
||||
|
||||
describe('Singleton', function () {
|
||||
it('can be instantiated', function () {
|
||||
$singleton = new Singleton();
|
||||
|
||||
expect($singleton)->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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user