feat: pending roles from crm to be confirmed by superadmins
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Config;
|
||||
|
||||
use App\Config\HouseCatalog;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class HouseCatalogTest extends TestCase
|
||||
{
|
||||
private const HOUSES = [
|
||||
'SVS' => 'Silvana',
|
||||
'AGR' => 'Rotbach',
|
||||
'DPW' => 'Waldschlössli',
|
||||
];
|
||||
|
||||
public function testNameChoicesAreSortedAndMapLabelToName(): void
|
||||
{
|
||||
$catalog = new HouseCatalog(self::HOUSES);
|
||||
|
||||
$this->assertSame([
|
||||
'Rotbach' => 'Rotbach',
|
||||
'Silvana' => 'Silvana',
|
||||
'Waldschlössli' => 'Waldschlössli',
|
||||
], $catalog->getNameChoices());
|
||||
}
|
||||
|
||||
public function testCodeChoicesAreSortedByLabelAndMapLabelToCode(): void
|
||||
{
|
||||
$catalog = new HouseCatalog(self::HOUSES);
|
||||
|
||||
$this->assertSame([
|
||||
'Rotbach' => 'AGR',
|
||||
'Silvana' => 'SVS',
|
||||
'Waldschlössli' => 'DPW',
|
||||
], $catalog->getCodeChoices());
|
||||
}
|
||||
|
||||
public function testGetName(): void
|
||||
{
|
||||
$catalog = new HouseCatalog(self::HOUSES);
|
||||
|
||||
$this->assertSame('Silvana', $catalog->getName('SVS'));
|
||||
$this->assertNull($catalog->getName('XYZ'));
|
||||
}
|
||||
|
||||
public function testEmptyCatalog(): void
|
||||
{
|
||||
$catalog = new HouseCatalog([]);
|
||||
|
||||
$this->assertSame([], $catalog->getNameChoices());
|
||||
$this->assertSame([], $catalog->getCodeChoices());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user