Release 1.30.4 (#3770)

* prevent empty invoice number
* prevent broken invoice filename
* fix recent timesheets for user
* allow to upload twig invoice template
This commit is contained in:
Kevin Papst
2023-01-19 15:13:44 +01:00
committed by GitHub
parent 559868fede
commit 7ea3eb1e3c
37 changed files with 191 additions and 50 deletions

View File

@@ -773,6 +773,36 @@ class TimesheetControllerTest extends APIControllerBaseTest
self::assertApiResponseTypeStructure('TimesheetCollectionFull', $result[0]);
}
public function testGetRecentActionForUser(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
$start = new \DateTime('-10 days');
$user = $this->getUserByRole(User::ROLE_ADMIN);
$fixture = new TimesheetFixtures();
$fixture->setFixedRate(true);
$fixture->setHourlyRate(true);
$fixture->setAmount(10);
$fixture->setUser($user);
$fixture->setStartDate($start);
$this->importFixture($fixture);
$query = [
'user' => $user->getId(),
'size' => 2,
'begin' => $start->format(self::DATE_FORMAT_HTML5),
];
$this->assertAccessIsGranted($client, '/api/timesheets/recent', 'GET', $query);
$result = json_decode($client->getResponse()->getContent(), true);
$this->assertIsArray($result);
$this->assertNotEmpty($result);
$this->assertEquals(1, \count($result));
self::assertApiResponseTypeStructure('TimesheetCollectionFull', $result[0]);
}
public function testActiveAction()
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);