コード例 #1
0
ファイル: ModuleTest.php プロジェクト: bluesnowman/fphp-saber
 /**
  * This method tests the "compare" method.
  *
  * @dataProvider data_compare
  */
 public function test_compare(array $provided, array $expected)
 {
     $p0 = ILinkedList\Module::compare(ILinkedList\Type::make($provided[0], '\\Saber\\Data\\IInt32\\Type'), ILinkedList\Type::make($provided[1], '\\Saber\\Data\\IInt32\\Type'));
     $e0 = $expected[0];
     $this->assertInstanceOf('\\Saber\\Data\\ITrit\\Type', $p0);
     $this->assertSame($e0, $p0->unbox());
 }
コード例 #2
0
ファイル: Module.php プロジェクト: bluesnowman/fphp-saber
 /**
  * This method returns the numerically lowest value.
  *
  * @access public
  * @static
  * @param ILinkedList\Type $xs                              the left operand
  * @param ILinkedList\Type $ys                              the right operand
  * @return ILinkedList\Type                                 the minimum value
  */
 public static function min(ILinkedList\Type $xs, ILinkedList\Type $ys) : ILinkedList\Type
 {
     return ILinkedList\Module::compare($xs, $ys)->unbox() <= 0 ? $xs : $ys;
 }