2021-12-19 18:38:42 +01:00
|
|
|
<?php
|
|
|
|
|
2023-02-03 20:41:59 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-12-19 18:38:42 +01:00
|
|
|
namespace Engelsystem\Test\Unit\Models\User;
|
|
|
|
|
|
|
|
use Engelsystem\Models\User\License;
|
|
|
|
use Engelsystem\Test\Unit\Models\ModelTest;
|
|
|
|
|
|
|
|
class LicenseTest extends ModelTest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Models\User\License::wantsToDrive
|
|
|
|
*/
|
2022-12-14 19:15:20 +01:00
|
|
|
public function testWantsToDrive(): void
|
2021-12-19 18:38:42 +01:00
|
|
|
{
|
|
|
|
$license = new License();
|
|
|
|
$this->assertFalse($license->wantsToDrive());
|
|
|
|
|
|
|
|
$license->has_car = true;
|
|
|
|
$this->assertFalse($license->wantsToDrive());
|
|
|
|
|
|
|
|
$license->drive_car = true;
|
|
|
|
$this->assertTrue($license->wantsToDrive());
|
|
|
|
|
|
|
|
// True if a user wants to drive anything
|
|
|
|
$license = new License(['drive_forklift' => true]);
|
|
|
|
$this->assertTrue($license->wantsToDrive());
|
|
|
|
|
|
|
|
$license = new License(['drive_car' => true]);
|
|
|
|
$this->assertTrue($license->wantsToDrive());
|
|
|
|
|
|
|
|
$license = new License(['drive_3_5t' => true]);
|
|
|
|
$this->assertTrue($license->wantsToDrive());
|
|
|
|
|
|
|
|
$license = new License(['drive_7_5t' => true]);
|
|
|
|
$this->assertTrue($license->wantsToDrive());
|
|
|
|
|
|
|
|
$license = new License(['drive_12t' => true]);
|
|
|
|
$this->assertTrue($license->wantsToDrive());
|
|
|
|
}
|
|
|
|
}
|