Completed
Push — master ( 0375a2...821836 )
by Ivannis Suárez
02:49
created

BinaryConstraintOperatorTestCase::testCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
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\Selector\SelectorInterface;
13
use Cubiche\Core\Selector\This;
14
use Cubiche\Core\Selector\Value;
15
use Cubiche\Core\Specification\Constraint\BinaryConstraintOperator;
16
use Cubiche\Core\Specification\Tests\Units\SpecificationTestCase;
17
18
/**
19
 * Binary Constraint Operator Test Case Class.
20
 *
21
 * @author Ivannis Suárez Jerez <[email protected]>
22
 * @author Karel Osorio Ramírez <[email protected]>
23
 */
24
abstract class BinaryConstraintOperatorTestCase extends SpecificationTestCase
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function defaultConstructorArguments()
30
    {
31
        return array(new This(), new Value(5));
32
    }
33
34
    /**
35
     * Test class.
36
     */
37
    public function testClass()
38
    {
39
        $this
40
            ->testedClass
41
                ->isSubClassOf(BinaryConstraintOperator::class)
42
        ;
43
    }
44
45
    /**
46
     * Test left/right.
47
     */
48
    public function testLeftRight()
49
    {
50
        $this
51
            /* @var \Cubiche\Core\Specification\Constraint\BinaryConstraintOperator $constraint */
52
            ->given($constraint = $this->newDefaultTestedInstance())
53
            ->then()
54
                ->object($constraint->left())
55
                    ->isInstanceOf(SelectorInterface::class)
56
                ->object($constraint->right())
57
                    ->isInstanceOf(SelectorInterface::class)
58
        ;
59
    }
60
}
61