phpOMS/tests/Math/Matrix/IdentityMatrixTest.php

39 lines
744 B
PHP

<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package tests
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace phpOMS\tests\Math\Matrix;
use phpOMS\Math\Matrix\IdentityMatrix;
/**
* @internal
*/
class IdentityMatrixTest extends \PHPUnit\Framework\TestCase
{
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()
);
}
}