Test Setup Failed
Push — master ( 193cf5...228aed )
by Sérgio
06:44
created

NoneTest::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Prelude\Tests;
4
5
use function Prelude\{none, not, equals};
6
7
class NoneTest extends \PHPUnit\Framework\TestCase
8
{
9
    public function test()
10
    {
11
        $isEven = function (int $n) { return $n % 2 === 0; };
12
        $isOdd = function (int $n) { return $n % 2 === 1; };
13
14
        $this->assertTrue(
15
            none($isEven)([1, 3, 5, 7, 9, 11])
16
        );
17
18
        $this->assertFalse(
19
            none($isEven)([1, 3, 5, 7, 9, 10])
20
        );
21
22
        $this->assertFalse(
23
            none($isOdd)([1, 3, 5, 7, 9, 11])
24
        );
25
    }
26
}
27