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:
@@ -110,7 +110,7 @@ class ApiDocControllerTest extends ControllerBaseTest
|
||||
|
||||
$this->assertArrayHasKey('security', $json);
|
||||
$this->assertArrayHasKey('X-AUTH-USER', $json['security'][0]);
|
||||
$this->assertArrayHasKey('X-AUTH-TOKEN', $json['security'][1]);
|
||||
$this->assertArrayHasKey('X-AUTH-TOKEN', $json['security'][0]);
|
||||
|
||||
$this->assertArrayHasKey('components', $json);
|
||||
$this->assertArrayHasKey('schemas', $json['components']);
|
||||
|
||||
@@ -111,25 +111,45 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
|
||||
$customer = $em->getRepository(Customer::class)->find(1);
|
||||
|
||||
$customer2 = (new Customer('first one'))->setVisible(false)->setCountry('de')->setTimezone('Europe/Berlin');
|
||||
$customer2 = new Customer('first one');
|
||||
$customer2->setVisible(false);
|
||||
$customer2->setCountry('de');
|
||||
$customer2->setTimezone('Europe/Berlin');
|
||||
$em->persist($customer2);
|
||||
|
||||
$customer3 = (new Customer('second one'))->setCountry('at')->setTimezone('Europe/Vienna');
|
||||
$customer3 = new Customer('second one');
|
||||
$customer3->setCountry('at');
|
||||
$customer3->setTimezone('Europe/Vienna');
|
||||
$em->persist($customer3);
|
||||
|
||||
$project = (new Project())->setName('first')->setVisible(false)->setCustomer($customer2);
|
||||
$project = new Project();
|
||||
$project->setName('first');
|
||||
$project->setVisible(false);
|
||||
$project->setCustomer($customer2);
|
||||
$em->persist($project);
|
||||
|
||||
$project = (new Project())->setName('second')->setVisible(false)->setCustomer($customer);
|
||||
$project = new Project();
|
||||
$project->setName('second');
|
||||
$project->setVisible(false);
|
||||
$project->setCustomer($customer);
|
||||
$em->persist($project);
|
||||
|
||||
$project = (new Project())->setName('third')->setVisible(true)->setCustomer($customer2);
|
||||
$project = new Project();
|
||||
$project->setName('third');
|
||||
$project->setVisible(true);
|
||||
$project->setCustomer($customer2);
|
||||
$em->persist($project);
|
||||
|
||||
$project = (new Project())->setName('fourth')->setVisible(true)->setCustomer($customer3);
|
||||
$project = new Project();
|
||||
$project->setName('fourth');
|
||||
$project->setVisible(true);
|
||||
$project->setCustomer($customer3);
|
||||
$em->persist($project);
|
||||
|
||||
$project = (new Project())->setName('fifth')->setVisible(true)->setCustomer($customer);
|
||||
$project = new Project();
|
||||
$project->setName('fifth');
|
||||
$project->setVisible(true);
|
||||
$project->setCustomer($customer);
|
||||
|
||||
// add meta fields
|
||||
$meta = new ProjectMeta();
|
||||
@@ -227,25 +247,23 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
$customer = (new Customer('first one'))
|
||||
->setVisible(true)
|
||||
->setCountry('de')
|
||||
->setTimezone('Europe/Berlin')
|
||||
;
|
||||
$customer = new Customer('first one');
|
||||
$customer->setVisible(true);
|
||||
$customer->setCountry('de');
|
||||
$customer->setTimezone('Europe/Berlin');
|
||||
$em->persist($customer);
|
||||
|
||||
$orderDate = new \DateTime('2019-11-29 14:35:17', new \DateTimeZone('Pacific/Tongatapu'));
|
||||
$startDate = new \DateTime('2020-01-07 18:19:20', new \DateTimeZone('Pacific/Tongatapu'));
|
||||
$endDate = new \DateTime('2021-03-23 00:00:01', new \DateTimeZone('Pacific/Tongatapu'));
|
||||
|
||||
$project = (new Project())
|
||||
->setName('first')
|
||||
->setVisible(true)
|
||||
->setCustomer($customer)
|
||||
->setOrderDate($orderDate)
|
||||
->setStart($startDate)
|
||||
->setEnd($endDate)
|
||||
;
|
||||
$project = new Project();
|
||||
$project->setName('first');
|
||||
$project->setVisible(true);
|
||||
$project->setCustomer($customer);
|
||||
$project->setOrderDate($orderDate);
|
||||
$project->setStart($startDate);
|
||||
$project->setEnd($endDate);
|
||||
$em->persist($project);
|
||||
$em->flush();
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ use JMS\Serializer\GraphNavigatorInterface;
|
||||
use JMS\Serializer\JsonSerializationVisitor;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\ErrorHandler\Exception\FlattenException;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Validator\ConstraintViolation;
|
||||
use Symfony\Component\Validator\ConstraintViolationList;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
@@ -467,11 +467,19 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
|
||||
$em = $this->getEntityManager();
|
||||
$customer = (new Customer('foo-bar-1'))->setVisible(false)->setCountry('DE')->setTimezone('Europe/Berlin');
|
||||
$customer = new Customer('foo-bar-1');
|
||||
$customer->setVisible(false);
|
||||
$customer->setCountry('DE');
|
||||
$customer->setTimezone('Europe/Berlin');
|
||||
$em->persist($customer);
|
||||
$project = (new Project())->setName('foo-bar-2')->setVisible(true)->setCustomer($customer);
|
||||
$project = new Project();
|
||||
$project->setName('foo-bar-2');
|
||||
$project->setVisible(true);
|
||||
$project->setCustomer($customer);
|
||||
$em->persist($project);
|
||||
$activity = (new Activity())->setName('foo-bar-3')->setVisible(true);
|
||||
$activity = new Activity();
|
||||
$activity->setName('foo-bar-3');
|
||||
$activity->setVisible(true);
|
||||
$em->persist($activity);
|
||||
$em->flush();
|
||||
|
||||
@@ -493,11 +501,19 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
|
||||
$em = $this->getEntityManager();
|
||||
$customer = (new Customer('foo-bar-1'))->setVisible(true)->setCountry('DE')->setTimezone('Europe/Berlin');
|
||||
$customer = new Customer('foo-bar-1');
|
||||
$customer->setVisible(true);
|
||||
$customer->setCountry('DE');
|
||||
$customer->setTimezone('Europe/Berlin');
|
||||
$em->persist($customer);
|
||||
$project = (new Project())->setName('foo-bar-2')->setVisible(true)->setCustomer($customer);
|
||||
$project = new Project();
|
||||
$project->setName('foo-bar-2');
|
||||
$project->setVisible(true);
|
||||
$project->setCustomer($customer);
|
||||
$em->persist($project);
|
||||
$activity = (new Activity())->setName('foo-bar-3')->setVisible(false);
|
||||
$activity = new Activity();
|
||||
$activity->setName('foo-bar-3');
|
||||
$activity->setVisible(false);
|
||||
$em->persist($activity);
|
||||
$em->flush();
|
||||
|
||||
@@ -517,12 +533,17 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
|
||||
$em = $this->getEntityManager();
|
||||
$customer = (new Customer('foo-bar-1'))->setCountry('DE')->setTimezone('Europe/Berlin');
|
||||
$customer = new Customer('foo-bar-1');
|
||||
$customer->setCountry('DE');
|
||||
$customer->setTimezone('Europe/Berlin');
|
||||
$customer->setBillable(false);
|
||||
$em->persist($customer);
|
||||
$project = (new Project())->setName('foo-bar-2')->setCustomer($customer);
|
||||
$project = new Project();
|
||||
$project->setName('foo-bar-2');
|
||||
$project->setCustomer($customer);
|
||||
$em->persist($project);
|
||||
$activity = (new Activity())->setName('foo-bar-3');
|
||||
$activity = new Activity();
|
||||
$activity->setName('foo-bar-3');
|
||||
$em->persist($activity);
|
||||
$em->flush();
|
||||
|
||||
@@ -547,12 +568,17 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
|
||||
$em = $this->getEntityManager();
|
||||
$customer = (new Customer('foo-bar-1'))->setCountry('DE')->setTimezone('Europe/Berlin');
|
||||
$customer = new Customer('foo-bar-1');
|
||||
$customer->setCountry('DE');
|
||||
$customer->setTimezone('Europe/Berlin');
|
||||
$customer->setBillable(false);
|
||||
$em->persist($customer);
|
||||
$project = (new Project())->setName('foo-bar-2')->setCustomer($customer);
|
||||
$project = new Project();
|
||||
$project->setName('foo-bar-2');
|
||||
$project->setCustomer($customer);
|
||||
$em->persist($project);
|
||||
$activity = (new Activity())->setName('foo-bar-3');
|
||||
$activity = new Activity();
|
||||
$activity->setName('foo-bar-3');
|
||||
$em->persist($activity);
|
||||
$em->flush();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user