feat(core) : add CoreModule, user repository contract, notifier contract and enriched user contract
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user