Completed
Push — master ( 610136...82575c )
by De Cramer
06:15 queued 03:00
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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testUnfound() 0 3 1
A getRule() 0 3 1
A testWithoutLocale() 0 3 1
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 1
    public function testWithoutLocale()
21
    {
22 1
        $this->assertRuleResults(['test' => 'toto 1'], [], ['field' => 'test'], 'toto 1');
23 1
    }
24
25
    /**
26
     * Test results when column don't exist.
27
     */
28 1
    public function testUnfound()
29
    {
30 1
        $this->assertRuleResults(['test' => 'toto 1'], [], ['field' => 'test-1'], null);
31 1
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36 3
    protected function getRule()
37
    {
38 3
        return new Get(new NullLogger());
39
    }
40
}