You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.1 KiB
PHP

<?php
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
*/
public function testWantsToDrive()
{
$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());
}
}