You are here

protected function FractionTest::fraction in Fraction 8

Same name and namespace in other branches
  1. 2.x tests/src/Unit/FractionTest.php \Drupal\Tests\fraction\Unit\FractionTest::fraction()

Returns a Fraction object from a a numerator and denominator.

This method should be identical to the fraction() function in fraction.module.

Parameters

$numerator: The fraction's numerator.

$denominator: The fraction's denominator.

Return value

\Drupal\fraction\Fraction Returns a $this->fraction object.

1 call to FractionTest::fraction()
FractionTest::testFraction in tests/src/Unit/FractionTest.php
Test the Fraction class and it's methods.

File

tests/src/Unit/FractionTest.php, line 29

Class

FractionTest
Provides tests for the Fraction class.

Namespace

Drupal\Tests\fraction\Unit

Code

protected function fraction($numerator = 0, $denominator = 1) {
  return new Fraction($numerator, $denominator);
}