File: VersionTest.php

package info (click to toggle)
php-giggsey-locale 2.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,160 kB
  • sloc: php: 53,967; xml: 61; makefile: 37
file content (33 lines) | stat: -rw-r--r-- 678 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

declare(strict_types=1);

/**
 * @author giggsey
 * @package Locale
 */

namespace Giggsey\Locale\Tests;

use Giggsey\Locale\Locale;
use PHPUnit\Framework\TestCase;

class VersionTest extends TestCase
{
    public function testGetVersion(): void
    {
        $version = null;

        $currentVersionContents = file(__DIR__ . '/../CLDR-VERSION.txt');

        foreach ($currentVersionContents as $line) {
            if (trim($line) !== '' && !str_starts_with($line, '#')) {
                $version = trim($line);
                break;
            }
        }

        $this->assertNotNull($version);
        $this->assertSame($version, Locale::getVersion());
    }
}