Release 2.12 (#4609)

This commit is contained in:
Kevin Papst
2024-02-07 23:47:25 +01:00
committed by GitHub
parent 7abe787778
commit 85a16a9363
394 changed files with 1189 additions and 6735 deletions

View File

@@ -22,7 +22,7 @@ use PHPUnit\Framework\TestCase;
*/
class ColorTest extends TestCase
{
public function testGetColorAndGetTimesheetColor()
public function testGetColorAndGetTimesheetColor(): void
{
$sut = new Color();
@@ -89,7 +89,7 @@ class ColorTest extends TestCase
self::assertEquals('#123456', $sut->getColor($timesheet, true));
}
public function testGetFontContrastColor()
public function testGetFontContrastColor(): void
{
$sut = new Color();
$this->assertEquals('#ffffff', $sut->getFontContrastColor('#666'));
@@ -100,7 +100,7 @@ class ColorTest extends TestCase
$this->assertEquals('#000000', $sut->getFontContrastColor('#ffffff'));
}
public function testGetFontContrastColorReturnsContrastForDefaultColorOnInvalidColor()
public function testGetFontContrastColorReturnsContrastForDefaultColorOnInvalidColor(): void
{
$sut = new Color();
$this->assertEquals('#000000', $sut->getFontContrastColor(''));
@@ -114,7 +114,7 @@ class ColorTest extends TestCase
$this->assertEquals('#000000', $sut->getFontContrastColor('#ccccccc'));
}
public function testGetRandomColor()
public function testGetRandomColor(): void
{
$sut = new Color();

View File

@@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
*/
class DurationTest extends TestCase
{
public function testFormat()
public function testFormat(): void
{
$sut = new Duration();
@@ -28,7 +28,7 @@ class DurationTest extends TestCase
/**
* @dataProvider getParseDurationTestData
*/
public function testParseDurationString($expected, $duration, $mode)
public function testParseDurationString($expected, $duration, $mode): void
{
$sut = new Duration();
$this->assertEquals($expected, $sut->parseDurationString($duration));
@@ -37,7 +37,7 @@ class DurationTest extends TestCase
/**
* @dataProvider getParseDurationTestData
*/
public function testParseDuration($expected, $duration, $mode)
public function testParseDuration($expected, $duration, $mode): void
{
$sut = new Duration();
$this->assertEquals($expected, $sut->parseDuration($duration, $mode));
@@ -105,7 +105,7 @@ class DurationTest extends TestCase
/**
* @dataProvider getParseDurationInvalidData
*/
public function testParseDurationThrowsInvalidArgumentException($duration, $mode)
public function testParseDurationThrowsInvalidArgumentException($duration, $mode): void
{
$this->expectException(\InvalidArgumentException::class);

View File

@@ -35,12 +35,12 @@ class FileHelperTest extends TestCase
/**
* @dataProvider getFileTestData
*/
public function testEnsureMaxLength(string $expected, string $original)
public function testEnsureMaxLength(string $expected, string $original): void
{
self::assertEquals($expected, FileHelper::convertToAsciiFilename($original));
}
public function testDataDirectory()
public function testDataDirectory(): void
{
$data = realpath(__DIR__ . '/../_data/');
$sut = new FileHelper($data);

View File

@@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
*/
class FormFormatConverterTest extends TestCase
{
public function testConvert()
public function testConvert(): void
{
$sut = new FormFormatConverter();
@@ -33,7 +33,7 @@ class FormFormatConverterTest extends TestCase
/**
* @dataProvider getProblemPattern
*/
public function testProblemPattern($format, $example)
public function testProblemPattern($format, $example): void
{
$sut = new FormFormatConverter();
$format = $sut->convert($format);
@@ -41,7 +41,7 @@ class FormFormatConverterTest extends TestCase
$this->assertMatchesRegularExpression($pattern, $example);
}
public function testDayPattern()
public function testDayPattern(): void
{
for ($i = 1; $i < 32; $i++) {
if ($i < 10) {
@@ -51,7 +51,7 @@ class FormFormatConverterTest extends TestCase
}
}
public function testHourPattern()
public function testHourPattern(): void
{
for ($i = 0; $i < 24; $i++) {
if ($i < 10) {
@@ -61,7 +61,7 @@ class FormFormatConverterTest extends TestCase
}
}
public function testMinutePattern()
public function testMinutePattern(): void
{
for ($i = 0; $i < 60; $i++) {
if ($i < 10) {
@@ -71,7 +71,7 @@ class FormFormatConverterTest extends TestCase
}
}
public function testMonthPattern()
public function testMonthPattern(): void
{
for ($i = 1; $i < 13; $i++) {
if ($i < 10) {
@@ -81,7 +81,7 @@ class FormFormatConverterTest extends TestCase
}
}
public function testYearPattern()
public function testYearPattern(): void
{
for ($i = 0; $i < 200; $i++) {
$this->assertMatchesRegularExpression('/^' . FormFormatConverter::PATTERN_YEAR . '$/', (string) (1900 + $i));
@@ -93,7 +93,7 @@ class FormFormatConverterTest extends TestCase
yield ["yy-MM-dd HH 'h' mm", '2009-08-06 17 h 45'];
}
public function testPattern()
public function testPattern(): void
{
$sut = new FormFormatConverter();
foreach ($this->getPossibleDateTimePattern() as $format => $example) {

View File

@@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase;
*/
class MarkdownTest extends TestCase
{
public function testMarkdownToHtml()
public function testMarkdownToHtml(): void
{
$sut = new Markdown();
$this->assertEquals('<p><em>test</em></p>', $sut->toHtml('*test*'));
@@ -65,7 +65,7 @@ class MarkdownTest extends TestCase
$this->assertEquals($html, $sut->toHtml($markdown));
}
public function testDuplicateIds()
public function testDuplicateIds(): void
{
$sut = new Markdown();
@@ -85,7 +85,7 @@ class MarkdownTest extends TestCase
$this->assertEquals($html, $sut->toHtml($markdown));
}
public function testLinksAreSanitized()
public function testLinksAreSanitized(): void
{
$sut = new Markdown();

View File

@@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
*/
class MenuItemModelTest extends TestCase
{
public function testChildRoutes()
public function testChildRoutes(): void
{
$sut = new MenuItemModel('test', 'foo', 'bar');

View File

@@ -20,7 +20,7 @@ use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage;
*/
class ProfileManagerTest extends TestCase
{
public function testEmpty()
public function testEmpty(): void
{
$request = new Request();
$session = new Session(new MockFileSessionStorage());
@@ -48,7 +48,7 @@ class ProfileManagerTest extends TestCase
/**
* @dataProvider getInvalidProfiles
*/
public function testIsInvalidProfile(string $profile)
public function testIsInvalidProfile(string $profile): void
{
$sut = new ProfileManager();
self::assertFalse($sut->isValidProfile($profile));
@@ -71,7 +71,7 @@ class ProfileManagerTest extends TestCase
/**
* @dataProvider getDatatableNames
*/
public function testDatatableName(string $expected, string $datatable, ?string $prefix)
public function testDatatableName(string $expected, string $datatable, ?string $prefix): void
{
$sut = new ProfileManager();
self::assertEquals($expected, $sut->getDatatableName($datatable, $prefix));
@@ -98,13 +98,13 @@ class ProfileManagerTest extends TestCase
/**
* @dataProvider getProfileNames
*/
public function testGetProfile(string $profile, string $expected)
public function testGetProfile(string $profile, string $expected): void
{
$sut = new ProfileManager();
self::assertEquals($expected, $sut->getProfile($profile));
}
public function testSetProfile()
public function testSetProfile(): void
{
$request = new Request();
$session = new Session(new MockFileSessionStorage());
@@ -139,7 +139,7 @@ class ProfileManagerTest extends TestCase
/**
* @dataProvider getCookieProfiles
*/
public function testGetProfileFromCookie(string $cookieValue, string $expected)
public function testGetProfileFromCookie(string $cookieValue, string $expected): void
{
$request = new Request();
self::assertFalse($request->cookies->has(ProfileManager::COOKIE_PROFILE));
@@ -168,7 +168,7 @@ class ProfileManagerTest extends TestCase
/**
* @dataProvider getSessionProfiles
*/
public function testGetProfileFromSession(string $sessionValue, string $expected)
public function testGetProfileFromSession(string $sessionValue, string $expected): void
{
$request = new Request();
self::assertFalse($request->cookies->has(ProfileManager::COOKIE_PROFILE));

View File

@@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
*/
class SearchTermTest extends TestCase
{
public function testNormalSearchTerm()
public function testNormalSearchTerm(): void
{
$sut = new SearchTerm('foo bar test 1');
self::assertEquals('foo bar test 1', $sut->getSearchTerm());
@@ -29,7 +29,7 @@ class SearchTermTest extends TestCase
self::assertEquals('foo bar test 1', (string) $sut);
}
public function testWithMetaField()
public function testWithMetaField(): void
{
$sut = new SearchTerm('foo:bar');
self::assertFalse($sut->hasSearchTerm());
@@ -41,7 +41,7 @@ class SearchTermTest extends TestCase
self::assertEquals('foo:bar', $sut->getOriginalSearch());
}
public function testWithMultipleMetaFields()
public function testWithMultipleMetaFields(): void
{
$sut = new SearchTerm('foo:bar bar:foo');
self::assertFalse($sut->hasSearchTerm());
@@ -55,7 +55,7 @@ class SearchTermTest extends TestCase
self::assertEquals('foo:bar bar:foo', $sut->getOriginalSearch());
}
public function testComplexWithMultipleAndDuplicateMetaFields()
public function testComplexWithMultipleAndDuplicateMetaFields(): void
{
$sut = new SearchTerm('foo:bar hello bar:foo world test foo:bar wuff');
self::assertTrue($sut->hasSearchTerm());

View File

@@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
*/
class StringHelperTest extends TestCase
{
public function testEnsureMaxLength()
public function testEnsureMaxLength(): void
{
self::assertNull(StringHelper::ensureMaxLength(null, 10));
self::assertEquals('', StringHelper::ensureMaxLength('', 10));
@@ -51,7 +51,7 @@ class StringHelperTest extends TestCase
/**
* @dataProvider getDdeAttackStrings
*/
public function testSanitizeDde(string $input)
public function testSanitizeDde(string $input): void
{
self::assertEquals("' " . $input, StringHelper::sanitizeDDE($input));
}
@@ -65,7 +65,7 @@ class StringHelperTest extends TestCase
/**
* @dataProvider getNonDdeAttackStrings
*/
public function testSanitizeDdeWithCorrectStrings(string $input)
public function testSanitizeDdeWithCorrectStrings(string $input): void
{
self::assertEquals($input, StringHelper::sanitizeDDE($input));
}