* fix phpdoc
* fix invoice export field order
* prevent empty migration warning
* do not trigger export validation on new timesheets
* update license year
* remove trailing comma in function call for php compatibility
* add new composer plugin config
* bump phpunit schema version
This commit is contained in:
Kevin Papst
2022-01-20 17:10:56 +01:00
committed by GitHub
parent 40242b7dcc
commit fd4cbb43c1
10 changed files with 37 additions and 16 deletions

View File

@@ -66,8 +66,9 @@ class TimesheetExportedValidatorTest extends ConstraintValidatorTestCase
$this->validator = $this->createMyValidator(false);
$this->validator->initialize($this->context);
$timesheet = new Timesheet();
$timesheet->setExported(true);
$timesheet = $this->createMock(Timesheet::class);
$timesheet->method('isExported')->willReturn(true);
$timesheet->method('getId')->willReturn(1);
$this->validator->validate($timesheet, new TimesheetExported());
@@ -77,6 +78,20 @@ class TimesheetExportedValidatorTest extends ConstraintValidatorTestCase
->assertRaised();
}
public function testNotTriggersOnNewTimesheet()
{
$this->validator = $this->createMyValidator(false);
$this->validator->initialize($this->context);
$timesheet = $this->createMock(Timesheet::class);
$timesheet->method('isExported')->willReturn(true);
$timesheet->method('getId')->willReturn(null);
$this->validator->validate($timesheet, new TimesheetExported());
$this->assertNoViolation();
}
public function testDoesNotTriggerWithPermission()
{
$this->validator = $this->createMyValidator(true);