Release 2.37 (#5546)

This commit is contained in:
Kevin Papst
2025-07-04 16:43:38 +02:00
committed by GitHub
parent 06b3060fe1
commit dfec807166
52 changed files with 602 additions and 352 deletions

View File

@@ -0,0 +1,40 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Tests\Command;
use App\Command\MailTestCommand;
use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* @covers \App\Command\MailTestCommand
* @group integration
*/
class MailTestCommandTest extends KernelTestCase
{
protected Application $application;
protected function setUp(): void
{
parent::setUp();
$kernel = self::bootKernel();
$this->application = new Application($kernel);
$this->application->add(new MailTestCommand(
$this->createMock(EventDispatcherInterface::class)
));
}
public function testCommandName(): void
{
$command = $this->application->find('kimai:mail:test');
self::assertInstanceOf(MailTestCommand::class, $command);
}
}

View File

@@ -319,6 +319,7 @@ class ConfigurationTest extends TestCase
0 => 'var/export/',
1 => 'templates/export/renderer/',
],
'timeout' => 60,
],
'calendar' => [
'week_numbers' => true,

View File

@@ -54,10 +54,28 @@ class ExportTemplateTest extends AbstractEntityTestCase
$sut->setOptions(['foo' => 1, 'bar' => true, 'WORLD' => 'HELLO']);
self::assertEquals(['foo' => 1, 'bar' => true, 'WORLD' => 'HELLO'], $sut->getOptions());
$sut->setOption('foo', 4711);
$sut->setOption('empty', null);
$sut->setOption('bar', false);
$sut->setOption('hello', 'kimai');
self::assertEquals(['foo' => 4711, 'bar' => false, 'WORLD' => 'HELLO', 'empty' => null, 'hello' => 'kimai'], $sut->getOptions());
$sut->setOptions(null);
self::assertEquals([], $sut->getOptions());
}
public function testSeparator(): void
{
$sut = new ExportTemplate();
self::assertEquals(',', $sut->getSeparator());
$sut->setSeparator(';');
self::assertEquals(';', $sut->getSeparator());
$sut->setSeparator(',');
self::assertEquals(',', $sut->getSeparator());
$this->expectException(\InvalidArgumentException::class);
$sut->setSeparator('.');
}
public function testClone(): void
{
$sut = new ExportTemplate();

View File

@@ -65,13 +65,13 @@ class CsvRendererTest extends AbstractRendererTestCase
{
$en = [
'Date', 'From', 'To', 'Duration', 'Currency', 'Price', 'Internal price', 'Hourly price', 'Fixed price', 'Name',
'User', 'Staff number', 'Customer', 'Project', 'Activity', 'Description', 'Billable', 'Tags',
'User', 'E-mail', 'Staff number', 'Customer', 'Project', 'Activity', 'Description', 'Billable', 'Tags',
'Type', 'category', 'Account', 'Project number', 'VAT-ID', 'Order number',
'Working place', 'Working place', 'Working place', 'Working place', 'Working place', 'Working place', 'mypref',
];
$de = [
'Datum', 'Von', 'Bis', 'Dauer', 'Währung', 'Preis', 'Interner Preis', 'Preis pro Stunde', 'Festpreis', 'Name',
'Benutzer', 'Personalnummer', 'Kunde', 'Projekt', 'Tätigkeit', 'Beschreibung', 'Abrechenbar', 'Schlagworte',
'Benutzer', 'E-Mail', 'Personalnummer', 'Kunde', 'Projekt', 'Tätigkeit', 'Beschreibung', 'Abrechenbar', 'Schlagworte',
'Typ', 'category', 'Kundennummer', 'Projektnummer', 'Umsatzsteuer-ID', 'Bestellnummer',
'Working place', 'Working place', 'Working place', 'Working place', 'Working place', 'Working place', 'mypref',
];
@@ -140,6 +140,7 @@ class CsvRendererTest extends AbstractRendererTestCase
'Kevin',
'kevin',
'',
'',
'Customer Name',
'project name',
'activity description',
@@ -175,6 +176,7 @@ class CsvRendererTest extends AbstractRendererTestCase
'niveK',
'nivek',
'',
'',
'Customer Name',
'project name',
'activity description',
@@ -200,6 +202,6 @@ class CsvRendererTest extends AbstractRendererTestCase
self::assertEquals($expected, $all[5]);
self::assertEquals($expected2, $all[6]);
self::assertEquals(\count($expected), \count($all[0]));
self::assertEquals('foo', $all[4][17]);
self::assertEquals('foo', $all[4][18]);
}
}

View File

@@ -133,6 +133,7 @@ class SpreadsheetRendererTest extends AbstractRendererTestCase
'project.meta.project-foo2' => 'Working place',
'activity.meta.activity-foo' => 'Working place',
'user.meta.mypref' => 'mypref',
'email' => 'email'
]];
$template = new Template('test', 'Testing');