ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMathTest.php
Go to the documentation of this file.
1<?php
2
19use PHPUnit\Framework\TestCase;
20
24class ilMathTest extends TestCase
25{
27
31 protected function setUp(): void
32 {
33 $this->eval_math = new EvalMath();
34 }
35
36 #[\PHPUnit\Framework\Attributes\DataProvider('gcdData')]
37 public function testGcd(string $a, string $b, string $result): void
38 {
39 $this->assertEquals($result, ilMath::getGreatestCommonDivisor($a, $b));
40 }
41
45 public static function gcdData(): array
46 {
47 return [
48 ['1254', '5298', '6'],
49 ['41414124', '41414124', '41414124']
50 ];
51 }
52}
static gcdData()
Definition: ilMathTest.php:45
EvalMath $eval_math
Definition: ilMathTest.php:26
testGcd(string $a, string $b, string $result)
Definition: ilMathTest.php:37
setUp()
@inheritDoc
Definition: ilMathTest.php:31
static getGreatestCommonDivisor($a, $b)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples