release 2.0 beta 2 (#3757)

* do not traverse into invoice template subdirectories (#3735)
* fix security open api definition
* fix currency can be null, removed fluent interface
* merged release 1.30.3
* allow to pre-fill timesheet metafields via URL
* fix api description
* added test accounts with simpler names and password
* upgrade to Symfony 6.2
* removed FrameworkExtraBundle (by Sensio) and replaced with new native SF annotations
* fixed symfony 6.2 deprecations
* fixed #3768
This commit is contained in:
Kevin Papst
2023-01-18 14:47:48 +01:00
committed by GitHub
parent 6e0500972e
commit 0e91dd886e
141 changed files with 1600 additions and 1415 deletions

View File

@@ -50,11 +50,9 @@ class TimesheetValidationTest extends KernelTestCase
$project->setCustomer(new Customer('foo'));
$entity = new Timesheet();
$entity
->setUser(new User())
->setProject($project)
->setBegin(new \DateTime())
;
$entity->setUser(new User());
$entity->setProject($project);
$entity->setBegin(new \DateTime());
$this->assertHasViolationForField($entity, 'activity');
}
@@ -62,11 +60,9 @@ class TimesheetValidationTest extends KernelTestCase
public function testValidationNeedsProject()
{
$entity = new Timesheet();
$entity
->setUser(new User())
->setActivity(new Activity())
->setBegin(new \DateTime())
;
$entity->setUser(new User());
$entity->setActivity(new Activity());
$entity->setBegin(new \DateTime());
$this->assertHasViolationForField($entity, 'project');
}
@@ -79,29 +75,30 @@ class TimesheetValidationTest extends KernelTestCase
$activity = (new Activity())->setName('hello-world')->setProject($project);
$entity = new Timesheet();
$entity
->setUser(new User())
->setActivity($activity)
->setProject($project2)
->setBegin(new \DateTime())
;
$entity->setUser(new User());
$entity->setActivity($activity);
$entity->setProject($project2);
$entity->setBegin(new \DateTime());
$this->assertHasViolationForField($entity, 'project');
}
public function testValidationCustomerInvisible()
{
$customer = (new Customer('foo'))->setVisible(false);
$project = (new Project())->setName('foo')->setCustomer($customer);
$activity = (new Activity())->setName('hello-world')->setProject($project);
$customer = new Customer('foo');
$customer->setVisible(false);
$project = new Project();
$project->setName('foo');
$project->setCustomer($customer);
$activity = new Activity();
$activity->setName('hello-world');
$activity->setProject($project);
$entity = new Timesheet();
$entity
->setUser(new User())
->setActivity($activity)
->setProject($project)
->setBegin(new \DateTime())
;
$entity->setUser(new User());
$entity->setActivity($activity);
$entity->setProject($project);
$entity->setBegin(new \DateTime());
$this->assertHasViolationForField($entity, 'customer');
}
@@ -109,13 +106,11 @@ class TimesheetValidationTest extends KernelTestCase
private function createStoppedTimesheet(Project $project, Activity $activity, ?int $id = null): Timesheet
{
$entity = new Timesheet();
$entity
->setUser(new User())
->setActivity($activity)
->setProject($project)
->setBegin(new \DateTime())
->setEnd(new \DateTime())
;
$entity->setUser(new User());
$entity->setActivity($activity);
$entity->setProject($project);
$entity->setBegin(new \DateTime());
$entity->setEnd(new \DateTime());
if ($id !== null) {
$o = new \ReflectionClass($entity);
@@ -130,9 +125,14 @@ class TimesheetValidationTest extends KernelTestCase
public function testValidationCustomerInvisibleDoesNotTriggerOnStoppedEntities()
{
$customer = (new Customer('foo'))->setVisible(false);
$project = (new Project())->setName('foo')->setCustomer($customer);
$activity = (new Activity())->setName('hello-world')->setProject($project);
$customer = new Customer('foo');
$customer->setVisible(false);
$project = new Project();
$project->setName('foo');
$project->setCustomer($customer);
$activity = new Activity();
$activity->setName('hello-world');
$activity->setProject($project);
$entity = $this->createStoppedTimesheet($project, $activity, 99);
@@ -141,9 +141,14 @@ class TimesheetValidationTest extends KernelTestCase
public function testValidationCustomerInvisibleDoesTriggerOnNewEntities()
{
$customer = (new Customer('foo'))->setVisible(false);
$project = (new Project())->setName('foo')->setCustomer($customer);
$activity = (new Activity())->setName('hello-world')->setProject($project);
$customer = new Customer('foo');
$customer->setVisible(false);
$project = new Project();
$project->setName('foo');
$project->setCustomer($customer);
$activity = new Activity();
$activity->setName('hello-world');
$activity->setProject($project);
$entity = $this->createStoppedTimesheet($project, $activity);
@@ -157,12 +162,10 @@ class TimesheetValidationTest extends KernelTestCase
$activity = (new Activity())->setName('hello-world')->setProject($project);
$entity = new Timesheet();
$entity
->setUser(new User())
->setActivity($activity)
->setProject($project)
->setBegin(new \DateTime())
;
$entity->setUser(new User());
$entity->setActivity($activity);
$entity->setProject($project);
$entity->setBegin(new \DateTime());
$this->assertHasViolationForField($entity, 'project');
}
@@ -196,12 +199,10 @@ class TimesheetValidationTest extends KernelTestCase
$activity = (new Activity())->setName('hello-world')->setProject($project)->setVisible(false);
$entity = new Timesheet();
$entity
->setUser(new User())
->setActivity($activity)
->setProject($project)
->setBegin(new \DateTime())
;
$entity->setUser(new User());
$entity->setActivity($activity);
$entity->setProject($project);
$entity->setBegin(new \DateTime());
$this->assertHasViolationForField($entity, 'activity');
}
@@ -209,8 +210,13 @@ class TimesheetValidationTest extends KernelTestCase
public function testValidationActivityInvisibleDoesNotTriggerOnStoppedEntities()
{
$customer = new Customer('foo');
$project = (new Project())->setName('foo')->setCustomer($customer);
$activity = (new Activity())->setName('hello-world')->setProject($project)->setVisible(false);
$project = new Project();
$project->setName('foo');
$project->setCustomer($customer);
$activity = new Activity();
$activity->setName('hello-world');
$activity->setProject($project);
$activity->setVisible(false);
$entity = $this->createStoppedTimesheet($project, $activity, 2);
@@ -220,8 +226,13 @@ class TimesheetValidationTest extends KernelTestCase
public function testValidationActivityInvisibleDoesTriggerOnNewEntities()
{
$customer = new Customer('foo');
$project = (new Project())->setName('foo')->setCustomer($customer);
$activity = (new Activity())->setName('hello-world')->setProject($project)->setVisible(false);
$project = new Project();
$project->setName('foo');
$project->setCustomer($customer);
$activity = new Activity();
$activity->setName('hello-world');
$activity->setProject($project);
$activity->setVisible(false);
$entity = $this->createStoppedTimesheet($project, $activity);