phpmyadmin/test/classes/Server/SysInfo/SysInfoTest.php
Maurício Meneghini Fauth 556594b4cd
Fix coding standard spacing issues
- Fixes one line doc comments
- Fixes parent call spacing
- Fixes constant spacing

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-24 21:06:17 -03:00

73 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Tests\Server\SysInfo;
use PhpMyAdmin\Server\SysInfo\Base;
use PhpMyAdmin\Server\SysInfo\SysInfo;
use PhpMyAdmin\Tests\AbstractTestCase;
/** @covers \PhpMyAdmin\Server\SysInfo\SysInfo */
class SysInfoTest extends AbstractTestCase
{
/**
* Test for OS detection
*
* @param string $os OS name as returned by PHP_OS
* @param string $expected Expected detected OS name
*
* @dataProvider sysInfoOsProvider
*/
public function testGetSysInfoOs(string $os, string $expected): void
{
$this->assertEquals(
$expected,
SysInfo::getOs($os),
);
}
/**
* Data provider for OS detection tests.
*
* @return string[][]
*/
public static function sysInfoOsProvider(): array
{
return [
[
'FreeBSD',
'Linux',
],
[
'Linux',
'Linux',
],
[
'Winnt',
'Winnt',
],
[
'SunOS',
'SunOS',
],
];
}
/**
* Test for getting sysinfo object.
*/
public function testGetSysInfo(): void
{
$this->assertInstanceOf(Base::class, SysInfo::get());
}
/**
* Test for getting supported sysinfo object.
*/
public function testGetSysInfoSupported(): void
{
$this->assertTrue(SysInfo::get()::isSupported());
}
}