phpOMS/tests/Math/Matrix/IdentityMatrixTest.php
2024-03-20 07:21:26 +00:00

43 lines
1.0 KiB
PHP
Executable File

<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package tests
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace phpOMS\tests\Math\Matrix;
use phpOMS\Math\Matrix\IdentityMatrix;
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Matrix\IdentityMatrix::class)]
#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Matrix\IdentityMatrixTest: Identity matrix')]
final class IdentityMatrixTest extends \PHPUnit\Framework\TestCase
{
#[\PHPUnit\Framework\Attributes\Group('framework')]
#[\PHPUnit\Framework\Attributes\TestDox('The identity matrix is the identity')]
public function testIdentity() : void
{
$id = new IdentityMatrix(5);
self::assertEquals(
[
[1, 0, 0, 0, 0],
[0, 1, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 1],
],
$id->toArray()
);
}
}