0
0
mirror of https://github.com/kevinpapst/kimai2.git synced 2024-12-22 04:08:29 +00:00
kevinpapst_kimai2/tests/ConstantsTest.php
2024-02-07 23:47:25 +01:00

33 lines
787 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\TestCase;
/**
* @covers \App\Constants
*/
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');
}
}