NotEqualTests   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 38
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A evaluateSuccessDataProvider() 0 7 1
A evaluateFailureDataProvider() 0 7 1
A testEvaluateEquatable() 0 10 1
1
<?php
2
/**
3
 * This file is part of the Cubiche package.
4
 *
5
 * Copyright (c) Cubiche
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Cubiche\Core\Specification\Tests\Units\Constraint;
11
12
use Cubiche\Core\Equatable\Tests\Fixtures\Value;
13
use Cubiche\Core\Specification\Criteria;
14
15
/**
16
 * Not Equal Tests Class.
17
 *
18
 * @author Ivannis Suárez Jerez <[email protected]>
19
 * @author Karel Osorio Ramírez <[email protected]>
20
 */
21
class NotEqualTests extends BinaryConstraintOperatorTestCase
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    protected function evaluateSuccessDataProvider()
27
    {
28
        return array(
29
            array(4.999),
30
            array(6),
31
        );
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    protected function evaluateFailureDataProvider()
38
    {
39
        return array(
40
            array(5),
41
            array(5.0),
42
        );
43
    }
44
45
    /**
46
     * Test evaluate Equatable instance.
47
     */
48
    public function testEvaluateEquatable()
49
    {
50
        $this
51
            ->given($neq = Criteria::neq(new Value(5)))
52
            ->then()
53
                ->boolean($neq->evaluate(new Value(5)))
54
                    ->isFalse()
55
                ->boolean($neq->evaluate(new Value(4)))
56
                    ->isTrue();
57
    }
58
}
59