Completed
Branch master (35ad35)
by Tristan
17:10 queued 07:53
created

SkipNullsFilterTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testPassesThroughFilterSuccess() 0 13 1
A testPassesThroughFilterFailure() 0 13 1
1
<?php
2
3
use Enzyme\Loopy\Filters\SkipNulls;
4
5
class SkipNullsFilterTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    public function testPassesThroughFilterSuccess()
8
    {
9
        $filter = new SkipNulls;
10
        $expected = true;
11
12
        $key = 1;
13
        $value = 1;
14
        $this->assertEquals($expected, $filter->passes($key, $value));
15
16
        $key = null;
17
        $value = 1;
18
        $this->assertEquals($expected, $filter->passes($key, $value));
19
    }
20
21
    public function testPassesThroughFilterFailure()
22
    {
23
        $filter = new SkipNulls;
24
        $expected = false;
25
26
        $key = 1;
27
        $value = null;
28
        $this->assertEquals($expected, $filter->passes($key, $value));
29
30
        $key = null;
31
        $value = null;
32
        $this->assertEquals($expected, $filter->passes($key, $value));
33
    }
34
}