AllTest::test()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Prelude\Tests;
4
5
use const Prelude\isScalar;
6
use function Prelude\all;
7
8
class AllTest extends \PHPUnit\Framework\TestCase
9
{
10
    public function test()
11
    {
12
        $even = function ($n) { return $n % 2 === 0; };
13
14
        $this->assertTrue(all($even)([2, 4, 6, 8, 10, 12]));
15
        $this->assertTrue(all(isScalar)([1, 2, 3, 4]));
16
        $this->assertFalse(all(isScalar)([1, 2, [], 4]));
17
    }
18
}
19