phpOMS/tests/Business/Finance/LorenzkurveTest.php
2018-01-15 17:20:46 +01:00

31 lines
648 B
PHP

<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
namespace Tests\PHPUnit\phpOMS\Business\Finance;
require_once __DIR__ . '/../../Autoloader.php';
use phpOMS\Business\Finance\Lorenzkurve;
class LorenzkurveTest extends \PHPUnit\Framework\TestCase
{
public function testLorenz()
{
$arr = [1, 1, 1, 1, 1, 1, 1, 10, 33, 50];
self::assertTrue(abs(0.71 - LorenzKurve::getGiniCoefficient($arr)) < 0.01);
}
}