コード例 #1
0
ファイル: FunctionsTest.php プロジェクト: tarsana/functional
 function test_all()
 {
     $betweenOneAndTen = F\all(F\gte(F\__(), 1), F\lte(F\__(), 10));
     $alwaysTrue = F\all();
     $this->assertEquals(true, $betweenOneAndTen(5));
     $this->assertEquals(false, $betweenOneAndTen(0));
     $this->assertEquals(true, $alwaysTrue(1));
     $this->assertEquals(true, $alwaysTrue(null));
 }
コード例 #2
0
ファイル: OperatorsTest.php プロジェクト: tarsana/functional
 public function test_gte()
 {
     $this->assertTrue(F\gte(6, 4));
     $this->assertTrue(F\gte(4, 4));
     $this->assertFalse(F\gte(2, 4));
 }