/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Math/Test/Unit/DivisionTest.php
43 строки
983 B
Manish Ranjan
AC-16248: PHPUnit 12 Upgrade | Fix Framework unit tests
09 янв 2026, 19:35
09 янв 2026, 19:35
de6cafc
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\Math\Test\Unit; use Magento\Framework\Math\Division; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\Attributes\DataProvider; class DivisionTest extends TestCase { /** * @var float */ private const EPSILON = 0.0000000001; /** */ #[DataProvider('getExactDivisionDataProvider')] public function testGetExactDivision($dividend, $divisor, $expected) { $mathDivision = new Division(); $remainder = $mathDivision->getExactDivision($dividend, $divisor); $this->assertEqualsWithDelta($expected, $remainder, self::EPSILON); } /** * @return array */ public static function getExactDivisionDataProvider() { return [ [17, 3 , 2], [7.7, 2 , 1.7], [17.8, 3.2 , 1.8], [11.7, 1.7 , 1.5], [8, 2, 0] ]; } }