Completed
Push — master ( 119a25...af28eb )
by Shcherbak
04:15
created

ComposerReviewTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 42
wmc 2
lcom 0
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getComposerFileDataProvider() 0 18 1
A testComposerFile() 0 7 1
1
<?php
2
3
  namespace Funivan\Cs\Tools\Composer\Tests;
4
5
  use Funivan\Cs\Tools\Composer\ComposerReview;
6
  use Tests\Funivan\Cs\ReviewTestCase;
7
8
  /**
9
   *
10
   */
11
  class ComposerReviewTest extends ReviewTestCase {
12
13
    /**
14
     * @return array
15
     */
16
    public function getComposerFileDataProvider() {
17
      return [
18
        [
19
          '{
20
            "name":"user/package",
21
            "description":"test"
22
          }',
23
          [],
24
        ],
25
        [
26
          '{
27
            "name":"user/package",
28
          }',
29
          [2],
30
        ],
31
32
      ];
33
    }
34
35
36
    /**
37
     * @dataProvider getComposerFileDataProvider
38
     *
39
     * @param int $tagType
0 ignored issues
show
Bug introduced by
There is no parameter named $tagType. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
40
     * @param string $input
41
     * @param array $expectErrorLines
42
     * @param bool $process
0 ignored issues
show
Bug introduced by
There is no parameter named $process. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
43
     */
44
    public function testComposerFile($input, array $expectErrorLines) {
45
      $tool = new ComposerReview();
46
      $report = $this->process($tool, $input);
47
48
      $this->assertInvalidLinesInReport($report, $expectErrorLines);
49
50
    }
51
52
  }
53