ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilMathTest.php
Go to the documentation of this file.
1 <?php
2 
20 
24 class ilMathTest extends TestCase
25 {
26  protected EvalMath $eval_math;
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
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
static getGreatestCommonDivisor($a, $b)
testGcd(string $a, string $b, string $result)
Definition: ilMathTest.php:37