ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilMathTest.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4use PHPUnit\Framework\TestCase;
5
10class ilMathTest extends TestCase
11{
15 protected $eval_math;
16
20 protected function setUp() : void
21 {
22 require_once 'Services/Math/classes/class.ilMath.php';
23 require_once 'Services/Math/classes/class.EvalMath.php';
24 $this->eval_math = new EvalMath();
25 }
26
30 public function testGcd($a, $b, $result)
31 {
32 $this->assertEquals($result, ilMath::getGreatestCommonDivisor($a, $b));
33 }
34
38 public function gcdData()
39 {
40 return [
41 ['1254', '5298', '6'],
42 ['41414124', '41414124', '41414124']
43 ];
44 }
45}
$result
An exception for terminatinating execution or to throw for unit testing.
testGcd($a, $b, $result)
@dataProvider gcdData
Definition: ilMathTest.php:30
static getGreatestCommonDivisor($a, $b)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples