Passed
Push — master ( f8cb44...13b119 )
by Luis
04:20 queued 01:13
created

incompatibleStatisticsCombinations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * PHP version 7.1
4
 *
5
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
6
 */
7
8
use PHPUnit\Framework\TestCase;
9
10
class PhUmlIncompatibleProcessorsTest extends TestCase
11
{
12
    /**
13
     * @test
14
     * @dataProvider incompatibleDotAndNeatoCombinations
15
     */
16 View Code Duplication
    function it_does_not_allow_dot_and_neato_as_initial_processors($firstProcessor, $secondProcessor)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
    {
18
        $incompatibleProcessors = <<<MESSAGE
19
phUML Version 0.2 (Jakob Westhoff <[email protected]>)
20
A fatal error occured during the process:
21
To processors in the chain are incompatible. The first processor's output is "application/phuml-structure". The next Processor in the queue does only support the following input types: text/dot.
22
23
MESSAGE;
24
25
        passthru(sprintf(
26
            'php %s %s -%s -%s willnotbecreated.png',
27
            __DIR__ . '/../../src/app/phuml',
28
            __DIR__ . '/../../src',
29
            $firstProcessor,
30
            $secondProcessor
31
        ));
32
33
        $this->expectOutputString($incompatibleProcessors);
34
    }
35
36
    function incompatibleDotAndNeatoCombinations()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
37
    {
38
        return [
39
            'dot -> neato' => ['dot', 'neato'],
40
            'dot -> statistics' => ['dot', 'statistics'],
41
            'dot -> graphviz' => ['dot', 'graphviz'],
42
            'neato -> dot' => ['neato', 'dot'],
43
            'neato -> statistics' => ['neato', 'statistics'],
44
            'neato -> graphviz' => ['dot', 'graphviz'],
45
        ];
46
    }
47
48
    /**
49
     * @test
50
     * @dataProvider incompatibleStatisticsCombinations
51
     */
52 View Code Duplication
    function it_does_not_allow_statistics_as_initial_processor($firstProcessor, $secondProcessor)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
53
    {
54
        $incompatibleProcessors = <<<MESSAGE
55
phUML Version 0.2 (Jakob Westhoff <[email protected]>)
56
A fatal error occured during the process:
57
To processors in the chain are incompatible. The first processor's output is "text/plain". The next Processor in the queue does only support the following input types: text/dot.
58
59
MESSAGE;
60
61
        passthru(sprintf(
62
            'php %s %s -%s -%s willnotbecreated.png',
63
            __DIR__ . '/../../src/app/phuml',
64
            __DIR__ . '/../../src',
65
            $firstProcessor,
66
            $secondProcessor
67
        ));
68
69
        $this->expectOutputString($incompatibleProcessors);
70
    }
71
72
    function incompatibleStatisticsCombinations()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
73
    {
74
        return [
75
            'statistics -> neato' => ['statistics', 'dot'],
76
            'statistics -> dot' => ['statistics', 'neato'],
77
        ];
78
    }
79
80
    /** @test */
81
    function it_does_not_allow_statistics_and_graphviz_combination()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
82
    {
83
        $incompatibleProcessors = <<<MESSAGE
84
phUML Version 0.2 (Jakob Westhoff <[email protected]>)
85
A fatal error occured during the process:
86
To processors in the chain are incompatible. The first processor's output is "text/plain". The next Processor in the queue does only support the following input types: application/phuml-structure.
87
88
MESSAGE;
89
90
        passthru(sprintf(
91
            'php %s %s -statistics -graphviz willnotbecreated.png',
92
            __DIR__ . '/../../src/app/phuml',
93
            __DIR__ . '/../../src'
94
        ));
95
96
        $this->expectOutputString($incompatibleProcessors);
97
    }
98
}
99