0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-05-10 03:40:46 +00:00
kevinpapst_kimai2/tests/Event/ThemeJavascriptTranslationsEventTest.php
Kevin Papst dfd97fd6f3
Release 2.34 (#5465)
* fix timing issue in timesheet edit form with deactivated rounding
* bump packages
* only show update messages for newer plugin versions
* replace deprecated method
* remove internal from API
* remove technical terms from translation
* prevent calls to internal symfony methods
* helper method to flag entry as modified
* support meta-fields in weekly-hourse view
* fix running timesheets were deleted in weekly-hourse
2025-05-09 14:22:47 +02:00

43 lines
1.4 KiB
PHP

<?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\Event;
use App\Event\ThemeJavascriptTranslationsEvent;
use PHPUnit\Framework\TestCase;
/**
* @covers \App\Event\ThemeJavascriptTranslationsEvent
* @group legacy
*/
class ThemeJavascriptTranslationsEventTest extends TestCase
{
public const COUNTER = 17;
public function testDefaultValues(): void
{
$sut = new ThemeJavascriptTranslationsEvent(); // @phpstan-ignore new.deprecatedClass
self::assertCount(self::COUNTER, $sut->getTranslations()); // @phpstan-ignore method.deprecatedClass
}
public function testGetterAndSetter(): void
{
$sut = new ThemeJavascriptTranslationsEvent(); // @phpstan-ignore new.deprecatedClass
$sut->setTranslation('foo', 'bar'); // @phpstan-ignore method.deprecatedClass
$sut->setTranslation('hello', 'world', 'testing'); // @phpstan-ignore method.deprecatedClass
$result = $sut->getTranslations(); // @phpstan-ignore method.deprecatedClass
self::assertCount(self::COUNTER + 2, $result);
self::assertArrayHasKey('foo', $result);
self::assertEquals(['bar', 'messages'], $result['foo']);
self::assertArrayHasKey('hello', $result);
self::assertEquals(['world', 'testing'], $result['hello']);
}
}