bugfixes (#3078)
* 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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user