phpOMS/tests/Math/Geometry/Shape/D3/TetrahedronTest.php
Dennis Eichhorn 0a8a5c63c5
Some checks failed
Compress images / calibreapp/image-actions (push) Has been cancelled
CI / general_module_workflow_php (push) Has been cancelled
fix permissions
2025-04-02 14:15:07 +00:00

47 lines
1.4 KiB
PHP

<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package tests
* @copyright Dennis Eichhorn
* @license OMS License 2.2
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace phpOMS\tests\Math\Geometry\Shape\D3;
use phpOMS\Math\Geometry\Shape\D3\Tetrahedron;
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D3\Tetrahedron::class)]
#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D3\TetrahedronTest: Tetrahedron shape')]
final class TetrahedronTest extends \PHPUnit\Framework\TestCase
{
#[\PHPUnit\Framework\Attributes\Group('framework')]
#[\PHPUnit\Framework\Attributes\TestDox('The volume can be calculated')]
public function testVolume() : void
{
self::assertEqualsWithDelta(3.18, Tetrahedron::getVolume(3), 0.01);
}
#[\PHPUnit\Framework\Attributes\Group('framework')]
#[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')]
public function testSurface() : void
{
self::assertEqualsWithDelta(15.59, Tetrahedron::getSurface(3), 0.01);
}
#[\PHPUnit\Framework\Attributes\Group('framework')]
#[\PHPUnit\Framework\Attributes\TestDox('The face area can be calculated')]
public function testFaceArea() : void
{
self::assertEqualsWithDelta(3.9, Tetrahedron::getFaceArea(3), 0.01);
}
}