feat: store questionnaire responses per disposition
This commit is contained in:
1 parent
8070fda64d
commit
df6734c939
9 files changed
+521
-1
No files matched your search
@@ -8,6 +8,7 @@ use App\Entity\Application;
|
||||
use App\Entity\Assignment;
|
||||
use App\Entity\Disposition;
|
||||
use App\Entity\Teamer;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@@ -65,6 +66,23 @@ class AssignmentTest extends TestCase
|
||||
$this->assertSame($disposition, $assignment->getActiveDispositionByTeamer($teamer));
|
||||
}
|
||||
|
||||
/**
|
||||
* The "Busbegleitung ab" field stores 0 for "Keine Busbegleitung" as well as null.
|
||||
*/
|
||||
#[DataProvider('providePickups')]
|
||||
public function testHasBusEscort(int|string|null $pickup, bool $expected): void
|
||||
{
|
||||
$this->assertSame($expected, (new Assignment())->setPickup($pickup)->hasBusEscort());
|
||||
}
|
||||
|
||||
public static function providePickups(): iterable
|
||||
{
|
||||
yield 'none' => [null, false];
|
||||
yield 'zero' => [0, false];
|
||||
yield 'empty form value' => ['', false];
|
||||
yield 'pickup' => [4711, true];
|
||||
}
|
||||
|
||||
private function createDisposition(Assignment $assignment, Teamer $teamer): Disposition
|
||||
{
|
||||
$disposition = new Disposition(new Application($assignment, $teamer));
|
||||
|
||||
Reference in new issue
Block a user