Esempio n. 1
0
 public function testHelperConstructorMethods()
 {
     $first = Rational::makeInteger($this->makeInteger(15));
     $this->assertRational($first);
     $this->assertEquals($first->getNumerator()->getValue(), 15);
     $this->assertEquals($first->getDenominator()->getValue(), 1);
     $second = Rational::makeZero($this->makeInteger(5));
     $this->assertRational($second);
     $this->assertEquals($second->getNumerator()->getValue(), 0);
     $this->assertEquals($second->getDenominator()->getValue(), 5);
     $third = Rational::makeZero();
     $this->assertRational($third);
     $this->assertEquals($third->getNumerator()->getValue(), 0);
     $this->assertNotEquals($third->getDenominator()->getValue(), 0);
 }