Skip to content

Commit

Permalink
fix array test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Nov 30, 2020
1 parent 89f9a25 commit 102013e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/MimeTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function it_can_convert_multiple_mimetypes_into_extensions(): void
'image/jpeg2',
]);

$this->assertEquals(
$this->assertEqualsArray(
['png', 'jpg', 'jpeg', 'jpe', 'jp2', 'jpg2'],
$extensions->all()
);
Expand All @@ -65,7 +65,7 @@ public function it_can_convert_multiple_extensions_into_mimetypes(): void
'jpg2',
]);

$this->assertEquals(
$this->assertEqualsArray(
['image/png', 'image/jpeg', 'image/pjpeg', 'image/jp2', 'image/jpeg2000', 'image/jpeg2000-image', 'image/x-jpeg2000-image'],
$extensions->all()
);
Expand All @@ -86,4 +86,8 @@ public function laravelServiceBindings(): array
[MimeTypes::class],
];
}

protected static function assertEqualsArray(array $expected, array $actual) {
static::assertSame(count($expected), count(array_intersect($expected, $actual)));
}
}

0 comments on commit 102013e

Please sign in to comment.