Code Duplication    Length = 21-22 lines in 2 locations

tests/unit/Domain/Blog/Introduction/MysqlIntroductionRepositoryTest.php 1 location

@@ 137-157 (lines=21) @@
134
        unlink('jpemeric_blog.db');
135
    }
136
137
    protected function insertData(array $data)
138
    {
139
        $defaultData = [
140
            'id' => null,
141
            'type' => '',
142
            'value' => '',
143
            'title' => '',
144
            'content' => '',
145
            'image' => null,
146
        ];
147
148
        $data = array_merge($defaultData, $data);
149
150
        return self::$connection->getDefault()->perform("
151
            INSERT INTO `jpemeric_blog`.`introduction`
152
                (id, type, value, title, content, image)
153
            VALUES
154
                (:id, :type, :value, :title, :content, :image)",
155
            $data
156
        );
157
    }
158
}
159

tests/unit/Domain/Stream/Changelog/MysqlChangelogRepositoryTest.php 1 location

@@ 176-197 (lines=22) @@
173
        unlink('jpemeric_stream.db');
174
    }
175
176
    protected function insertData(array $data)
177
    {
178
        $defaultData = [
179
            'id' => null,
180
            'hash' => '',
181
            'message' => null,
182
            'message_short' => null,
183
            'datetime' => '',
184
            'author' => '',
185
            'commit_link' => '',
186
        ];
187
188
        $data = array_merge($defaultData, $data);
189
190
        return self::$connection->getDefault()->perform("
191
            INSERT INTO `jpemeric_stream`.`changelog`
192
                (id, hash, message, message_short, datetime, author, commit_link)
193
            VALUES
194
                (:id, :hash, :message, :message_short, :datetime, :author, :commit_link)",
195
            $data
196
        );
197
    }
198
}
199