Completed
Push — master ( 89612e...daf835 )
by Axel
02:08
created

PlusForTrelloHelperTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 13
dl 0
loc 45
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provideData() 0 35 1
A testExtractEstimations() 0 3 1
1
<?php
2
3
namespace Tests\Utils;
4
5
use Scrumban\Utils\PlusForTrelloHelper;
6
7
class PlusForTrelloHelperTest extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
{
9
    /**
10
     * @dataProvider provideData
11
     */
12
    public function testExtractEstimations($comments, $expectedEstimations)
13
    {
14
        $this->assertEquals($expectedEstimations, PlusForTrelloHelper::extractEstimations($comments));
15
    }
16
    
17
    public function provideData()
18
    {
19
        return [
20
            [
21
                [
22
                    [
23
                        'data' => [ 'text' => 'plus! 0/6' ]
24
                    ],
25
                    [
26
                        'data' => [ 'text' => 'plus! 2/0' ]
27
                    ],
28
                    [
29
                        'data' => [ 'text' => 'plus! 1/0' ]
30
                    ]
31
                ],
32
                [
33
                    'estimated' => 6,
34
                    'spent' => 3
35
                ]
36
            ],
37
            [
38
                [
39
                    [
40
                        'data' => [ 'text' => 'plus! 0/3' ]
41
                    ],
42
                    [
43
                        'data' => [ 'text' => 'plus! 2/0' ]
44
                    ],
45
                    [
46
                        'data' => [ 'text' => 'plus! @developer 2/1' ]
47
                    ]
48
                ],
49
                [
50
                    'estimated' => 4,
51
                    'spent' => 4
52
                ]
53
            ]
54
        ];
55
    }
56
}