Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: make php-cs happy
Signed-off-by: Josh <[email protected]>
  • Loading branch information
joshtrichards authored Dec 10, 2025
commit b2bc785986d6d81965645eaf346a041709e7a5fb
8 changes: 4 additions & 4 deletions tests/lib/Files/Type/DetectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function testDetectMimeTypeCustom(string $ext, string $mime): void {
try {
// Create a default / shipped mapping file (dist)
file_put_contents($tmpDir . '/mimetypemapping.dist.json', json_encode([]));

// Create new custom mapping file that should be picked up by Detection
file_put_contents($tmpDir . '/mimetypemapping.json', json_encode([$ext => [$mime]]));

Expand Down Expand Up @@ -158,15 +158,15 @@ public function testDetectMimeTypePreservesLeadingZeroKeys(): void {
// Create new custom mapping file with potentially problematic keys
$mappings = [
'001' => ['application/x-zeroone', null],
'1' => ['application/x-one', null],
'1' => ['application/x-one', null],
];
file_put_contents($tmpDir . '/mimetypemapping.json', json_encode($mappings));

/** @var IURLGenerator $urlGenerator */
$urlGenerator = $this->getMockBuilder(IURLGenerator::class)
->disableOriginalConstructor()
->getMock();

/** @var LoggerInterface $logger */
$logger = $this->createMock(LoggerInterface::class);

Expand All @@ -175,7 +175,7 @@ public function testDetectMimeTypePreservesLeadingZeroKeys(): void {

$this->assertArrayHasKey('001', $mappings, 'Expected mapping to contain key "001"');
$this->assertArrayHasKey('1', $mappings, 'Expected mapping to contain key "1"');

$this->assertEquals('application/x-zeroone', $detection->detectPath('foo.001'));
$this->assertEquals('application/x-one', $detection->detectPath('foo.1'));
} finally {
Expand Down
Loading