Code Duplication    Length = 20-20 lines in 2 locations

src/TreeHouse/IoBundle/Test/Import/FeedType/AbstractFeedTypeTestCase.php 1 location

@@ 143-162 (lines=20) @@
140
     * @param mixed  $expectedValue
141
     * @param mixed  $actualValue
142
     */
143
    protected function normalizeValues($key, &$expectedValue, &$actualValue)
144
    {
145
        // some integers are modified to doubles, this is ok though
146
        if (is_integer($expectedValue) && is_double($actualValue)) {
147
            $expectedValue = (double) $expectedValue;
148
        }
149
150
        // the order of non-associative arrays does not matter
151
        if (is_array($expectedValue) && is_numeric(key($expectedValue)) && is_array($actualValue)) {
152
            sort($expectedValue);
153
            sort($actualValue);
154
        }
155
156
        // only test the day of dates
157
        foreach (['expectedValue', 'actualValue'] as $var) {
158
            if (is_string($$var) && preg_match('/^(\d{4}\-\d{2}\-\d{2})T[0-9\:\+]+$/', $$var, $matches)) {
159
                $$var = $matches[1];
160
            }
161
        }
162
    }
163
164
    /**
165
     * @param string $name     The fixture name

src/TreeHouse/IoBundle/Test/Scrape/Parser/ParserTypeTestCase.php 1 location

@@ 164-183 (lines=20) @@
161
     * @param mixed  $expectedValue
162
     * @param mixed  $actualValue
163
     */
164
    protected function normalizeValues($key, &$expectedValue, &$actualValue)
165
    {
166
        // some integers are modified to doubles, this is ok though
167
        if (is_integer($expectedValue) && is_double($actualValue)) {
168
            $expectedValue = (double) $expectedValue;
169
        }
170
171
        // the order of non-associative arrays does not matter
172
        if (is_array($expectedValue) && is_numeric(key($expectedValue)) && is_array($actualValue)) {
173
            sort($expectedValue);
174
            sort($actualValue);
175
        }
176
177
        // only test the day of dates
178
        foreach (['expectedValue', 'actualValue'] as $var) {
179
            if (is_string($$var) && preg_match('/^(\d{4}\-\d{2}\-\d{2})T[0-9\:\+]+$/', $$var, $matches)) {
180
                $$var = $matches[1];
181
            }
182
        }
183
    }
184
185
    /**
186
     * @param string $parserType