feat(core) : add CoreModule, user repository contract, notifier contract and enriched user contract

This commit is contained in:
Matthieu
2026-06-19 15:53:38 +02:00
parent 8865bf51e6
commit 6ca91cbd3b
6 changed files with 162 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace App\Tests\Unit\Module\Core;
use App\Module\Core\CoreModule;
use App\Shared\Domain\Module\ModuleInterface;
use PHPUnit\Framework\TestCase;
/**
* @internal
*/
final class CoreModuleTest extends TestCase
{
public function testItIsAModule(): void
{
self::assertInstanceOf(ModuleInterface::class, new CoreModule());
}
public function testIdentity(): void
{
self::assertSame('core', CoreModule::id());
self::assertTrue(CoreModule::isRequired());
self::assertNotSame('', CoreModule::label());
}
public function testPermissionsAreWellFormed(): void
{
foreach (CoreModule::permissions() as $permission) {
self::assertArrayHasKey('code', $permission);
self::assertArrayHasKey('label', $permission);
}
}
}
@@ -79,6 +79,42 @@ final class TimestampableBlamableSubscriberTest extends TestCase
{
return $this->id;
}
public function getUserIdentifier(): string
{
return 'user-'.$this->id;
}
public function getUsername(): ?string
{
return 'user-'.$this->id;
}
/** @return list<string> */
public function getRoles(): array
{
return ['ROLE_USER'];
}
public function getFirstName(): ?string
{
return null;
}
public function getLastName(): ?string
{
return null;
}
public function getAvatarUrl(): ?string
{
return null;
}
public function getIsEmployee(): bool
{
return false;
}
};
}