/** * This method tests the "compare" method. * * @dataProvider data_compare */ public function test_compare(array $provided, array $expected) { $p0 = IChar\Module::compare(IChar\Type::box($provided[0]), IChar\Type::box($provided[1])); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\ITrit\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }
/** * This method returns the numerically lowest value. * * @access public * @static * @param IChar\Type $x the left operand * @param IChar\Type $y the right operand * @return IChar\Type the minimum value */ public static function min(IChar\Type $x, IChar\Type $y) : IChar\Type { return IChar\Module::compare($x, $y)->unbox() <= 0 ? $x : $y; }