/** * This method tests the "eq" method. */ public function test_eq() { $p0 = IUnit\Module::eq(IUnit\Type::instance(), IUnit\Type::instance()); $e0 = true; $this->assertInstanceOf('\\Saber\\Data\\IBool\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }
/** * This method compares the operands for order. * * @access public * @static * @param IUnit\Type $x the left operand * @param IUnit\Type $y the right operand * @return ITrit\Type the order as to whether the left * operand is less than, equals to, * or greater than the right operand */ public static function compare(IUnit\Type $x, IUnit\Type $y) : ITrit\Type { if (IUnit\Module::eq($x, $y)->unbox()) { return ITrit\Type::zero(); } return ITrit\Type::make(strcmp($x->__typeOf(), $y->__typeOf())); }