mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-28 05:54:05 +02:00
Added possibility to autoselect the import format
This commit is contained in:
parent
61e2dde400
commit
508641d1e8
6 changed files with 106 additions and 6 deletions
|
@ -151,4 +151,24 @@ EOT;
|
|||
$this->assertCount(2, $errors);
|
||||
$this->assertSame('Node 1', $errors[0]['entity']->getName());
|
||||
}
|
||||
|
||||
public function formatDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['csv', 'csv'],
|
||||
['csv', 'CSV'],
|
||||
['xml', 'Xml'],
|
||||
['json', 'json'],
|
||||
['yaml', 'yml'],
|
||||
['yaml', 'YAML'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider formatDataProvider
|
||||
*/
|
||||
public function testDetermineFormat(string $expected, string $extension): void
|
||||
{
|
||||
$this->assertSame($expected, $this->service->determineFormat($extension));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue