Completed
Push — master ( 4e5ef4...37558b )
by De Cramer
02:05
created

GetTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3
1
<?php
2
3
namespace Oliverde8\Component\RuleEngine\Tests\Rules;
4
5
use Oliverde8\Component\RuleEngine\Rules\Get;
6
use Psr\Log\NullLogger;
7
8
/**
9
 * Class ValueGetterTest
10
 *
11
 * @author    de Cramer Oliver<[email protected]>
12
 * @copyright 2018 Smile
13
 * @package Oliverde8\Component\RuleEngine\Tests\Rules
14
 */
15
class GetTest extends AbstractRule
16
{
17
    /**
18
     * Test fetching a simple value without locale information.
19
     */
20
    public function testWithoutLocale()
21
    {
22
        $this->assertRuleResults(['test' => 'toto 1'], [], ['field' => 'test'], 'toto 1');
23
    }
24
25
    /**
26
     * Test results when column don't exist.
27
     */
28
    public function testUnfound()
29
    {
30
        $this->assertRuleResults(['test' => 'toto 1'], [], ['field' => 'test-1'], null);
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    protected function getRule()
37
    {
38
        return new Get(new NullLogger());
39
    }
40
}