GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( 06bc6c...e92c95 )
by Mewes
03:57
created

CsvTwigTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 30.77 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 16
loc 52
rs 10
c 0
b 0
f 0

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace MewesK\TwigSpreadsheetBundle\Tests\Twig;
4
5
/**
6
 * Class CsvTwigTest.
7
 *
8
 * @coversNothing
9
 */
10
class CsvTwigTest extends BaseTwigTest
11
{
12
    protected static $TEMP_PATH = '/../../tmp/csv/';
13
14
    //
15
    // PhpUnit
16
    //
17
18
    /**
19
     * @return array
20
     */
21
    public function formatProvider()
22
    {
23
        return [['csv']];
24
    }
25
26
    //
27
    // Tests
28
    //
29
30
    /**
31
     * @param string $format
32
     *
33
     * @throws \Exception
34
     *
35
     * @dataProvider formatProvider
36
     */
37
    public function testBasic($format)
38
    {
39
        $path = $this->getDocument('documentSimple', $format);
40
41
        static::assertFileExists($path, 'File does not exist');
42
        static::assertGreaterThan(0, filesize($path), 'File is empty');
43
        static::assertStringEqualsFile($path, '"Foo","Bar"'.PHP_EOL.'"Hello","World"'.PHP_EOL, 'Unexpected content');
44
    }
45
46
    /**
47
     * @param string $format
48
     *
49
     * @throws \Exception
50
     *
51
     * @dataProvider formatProvider
52
     */
53
    public function testDocumentTemplate($format)
54
    {
55
        $path = $this->getDocument('documentTemplate.csv', $format);
56
57
        static::assertFileExists($path, 'File does not exist');
58
        static::assertGreaterThan(0, filesize($path), 'File is empty');
59
        static::assertStringEqualsFile($path, '"Hello2","World"'.PHP_EOL.'"Foo","Bar2"'.PHP_EOL, 'Unexpected content');
60
    }
61
}
62