示例#1
0
 /**
  * This method tests the "all" method.
  *
  * @dataProvider data_all
  */
 public function test_all(array $provided, array $expected)
 {
     $p0 = IArrayList\Type::make($provided[0], '\\Saber\\Data\\IInt32\\Type');
     $p1 = $provided[1];
     $r0 = IArrayList\Module::all($p0, $p1);
     $e0 = $expected[0];
     $this->assertInstanceOf('\\Saber\\Data\\IBool\\Type', $r0);
     $this->assertSame($e0, $r0->unbox());
 }
示例#2
0
 /**
  * This method returns whether all of the items of the list evaluate to true.
  *
  * @access public
  * @static
  * @param IArrayList\Type $xs                               the left operand
  * @return IBool\Type                                       whether all of the items of
  *                                                          the list evaluate to true
  */
 public static function and_(IArrayList\Type $xs) : IBool\Type
 {
     return IArrayList\Module::all($xs, function (IBool\Type $x, IInt32\Type $i) : IBool\Type {
         return $x;
     });
 }