Code Duplication    Length = 8-11 lines in 3 locations

Tests/Units/ArrayCollectionTests.php 2 locations

@@ 273-283 (lines=11) @@
270
    /**
271
     * Test keys.
272
     */
273
    public function testKeys()
274
    {
275
        $this
276
            ->given(
277
                $collection = $this->randomCollection()
278
            )
279
            ->when($keys = $collection->keys())
280
                ->collection($keys)
281
                   ->array($keys->toArray())
282
                        ->isEqualTo(\array_keys($collection->toArray()));
283
    }
284
285
    /**
286
     * Test values.
@@ 288-298 (lines=11) @@
285
    /**
286
     * Test values.
287
     */
288
    public function testValues()
289
    {
290
        $this
291
            ->given(
292
                $collection = $this->randomCollection()
293
            )
294
            ->when($values = $collection->values())
295
                ->collection($values)
296
                    ->array($values->toArray())
297
                        ->isEqualTo(\array_values($collection->toArray()));
298
    }
299
}
300

Tests/Units/CollectionTestCase.php 1 location

@@ 299-306 (lines=8) @@
296
    /**
297
     * Test toArray.
298
     */
299
    public function testToArray()
300
    {
301
        $this
302
            ->given($collection = $this->randomCollection())
303
            ->when($array = $collection->toArray())
304
                ->array($array)
305
                    ->isEqualTo(\iterator_to_array($collection->getIterator()));
306
    }
307
308
    /**
309
     * Test slice.