Completed
Push — master ( 0b7415...f7faeb )
by Siwapun
04:16 queued 02:45
created

ArrayForEachTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testForEach() 0 11 1
1
<?php
2
namespace Aerophant\RamdaTest;
3
4
use function Aerophant\Ramda\arrayForEach;
5
use PHPUnit\Framework\TestCase;
6
7
class ArrayForEachTest extends TestCase
8
{
9
10
  public function testForEach()
11
  {
12
    $list = [1, 2, 3];
13
    $mockFn = $this->createPartialMock(\stdClass::class, ['__invoke']);
14
    $mockFn->expects($this->exactly(3))
15
      ->method('__invoke')
16
      ->with($this->callback(function ($it) use ($list) {
17
        return in_array($it, $list);
18
      }));
19
20
    arrayForEach($mockFn)($list);
21
  }
22
}
23