示例#1
0
 public function testAsRationalReturnsRationalType()
 {
     $t = new IntType(2);
     $r = $t->AsRational();
     $this->assertInstanceOf('\\Chippyash\\Type\\Number\\Rational\\RationalType', $r);
     $this->assertEquals('2', (string) $r);
     $this->assertInstanceOf('Chippyash\\Type\\Number\\IntType', $r->numerator());
     $this->assertInstanceOf('Chippyash\\Type\\Number\\IntType', $r->denominator());
 }