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