Files
kimai2/tests/ConstantsTest.php
2025-08-11 18:57:42 +02:00

32 lines
832 B
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;
use App\Constants;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
#[CoversClass(Constants::class)]
class ConstantsTest extends TestCase
{
public function testBuild(): void
{
$version = Constants::VERSION;
$versionParts = explode('.', $version);
$major = (int) $versionParts[0];
$minor = (int) $versionParts[1];
$patch = isset($versionParts[2]) ? (int) $versionParts[2] : 0;
$expectedId = $major * 10000 + $minor * 100 + $patch;
self::assertEquals($expectedId, Constants::VERSION_ID, 'Invalid version ID');
}
}