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