Code Duplication    Length = 15-19 lines in 3 locations

tests/unit/IO/StreamWriterTest.php 3 locations

@@ 44-62 (lines=19) @@
41
        return stream_get_contents($this->stream);
42
    }
43
44
    public function testInsertArray()
45
    {
46
        $data = [
47
            ['a', 'b', 'c', 'd'],
48
            ['e', 'f', 'g', 'h'],
49
        ];
50
51
        $writer = new StreamWriter($this->stream, new CsvFormatter(new CsvFormat()));
52
53
        $writer->insertAll($data);
54
55
        $expected = <<<CSV
56
"a","b","c","d"
57
"e","f","g","h"
58
CSV;
59
60
        fseek($this->stream, 0, SEEK_SET);
61
        static::assertEquals($expected, $this->getContents());
62
    }
63
64
    public function testInsertIterator()
65
    {
@@ 64-82 (lines=19) @@
61
        static::assertEquals($expected, $this->getContents());
62
    }
63
64
    public function testInsertIterator()
65
    {
66
        $data = new ArrayIterator([
67
            ['a', 'b', 'c', 'd'],
68
            ['e', 'f', 'g', 'h'],
69
        ]);
70
71
        $writer = new StreamWriter($this->stream, new CsvFormatter(new CsvFormat()));
72
73
        $writer->insertAll($data);
74
75
        $expected = <<<CSV
76
"a","b","c","d"
77
"e","f","g","h"
78
CSV;
79
80
        fseek($this->stream, 0, SEEK_SET);
81
        static::assertEquals($expected, $this->getContents());
82
    }
83
84
    public function testInsertRow()
85
    {
@@ 84-98 (lines=15) @@
81
        static::assertEquals($expected, $this->getContents());
82
    }
83
84
    public function testInsertRow()
85
    {
86
        $writer = new StreamWriter($this->stream, new CsvFormatter(new CsvFormat()));
87
88
        $writer->insert(['a', 'b', 'c', 'd']);
89
        $writer->insert(['e', 'f', 'g', 'h']);
90
91
        $expected = <<<CSV
92
"a","b","c","d"
93
"e","f","g","h"
94
CSV;
95
96
        fseek($this->stream, 0, SEEK_SET);
97
        static::assertEquals($expected, $this->getContents());
98
    }
99
100
    public function testFormatterBlocks()
101
    {