ComposerReviewTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getComposerFileDataProvider() 0 18 1
A testComposerFile() 0 4 1
1
<?php
2
3
  namespace Funivan\Cs\Tools\Composer\Tests;
4
5
  use Funivan\Cs\Tools\Composer\ComposerReview;
6
  use Tests\Funivan\Cs\BaseTestCase;
7
8
  /**
9
   *
10
   */
11
  class ComposerReviewTest extends BaseTestCase {
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
     * @param string $input
39
     * @param array $expectErrorLines
40
     * @throws \Exception
41
     */
42
    public function testComposerFile($input, array $expectErrorLines) {
43
      $tool = new ComposerReview();
44
      static::assertReview($tool, $input, $expectErrorLines);
45
    }
46
47
  }
48