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

NoneTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test() 0 17 1
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