Code Duplication    Length = 12-12 lines in 2 locations

tests/unit/Tokeniser/StreamTokeniserTest.php 1 location

@@ 21-32 (lines=12) @@
18
     * @param string                    $csv
19
     * @param array                     $tokens
20
     */
21
    public function testTokeniser(CsvConfigurationInterface $config, $csv, array $tokens)
22
    {
23
        $tokeniser = new StreamTokeniser($config, $this->getStream($csv));
24
25
        $actual = iterator_to_array($tokeniser->getTokens());
26
27
        $tokensOnly = array_map(function (Token $token) {
28
            return [$token->getType(), $token->getPosition(), $token->getLength(), $token->getContent()];
29
        }, $actual);
30
31
        static::assertEquals($tokens, $tokensOnly);
32
    }
33
34
    /**
35
     * @param string $string

tests/unit/Tokeniser/StringTokeniserTest.php 1 location

@@ 20-31 (lines=12) @@
17
     * @param string                    $csv
18
     * @param array                     $tokens
19
     */
20
    public function testTokeniser(CsvConfigurationInterface $config, $csv, array $tokens)
21
    {
22
        $tokeniser = new StringTokeniser($config, $csv);
23
24
        $actual = iterator_to_array($tokeniser->getTokens());
25
26
        $tokensOnly = array_map(function (Token $token) {
27
            return [$token->getType(), $token->getPosition(), $token->getLength(), $token->getContent()];
28
        }, $actual);
29
30
        static::assertEquals($tokens, $tokensOnly);
31
    }
32
33
    /**
34
     * @return array