mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-19 10:24:50 +02:00
Improved code style of tests
This commit is contained in:
parent
5629215ce4
commit
684334ba22
73 changed files with 196 additions and 38 deletions
|
@ -29,6 +29,7 @@ use Symfony\Component\Filesystem\Filesystem;
|
|||
/**
|
||||
* This service converts the relative pathes for attachments saved in database (like %MEDIA%/img.jpg) to real pathes
|
||||
* an vice versa.
|
||||
* @see \App\Tests\Services\Attachments\AttachmentPathResolverTest
|
||||
*/
|
||||
class AttachmentPathResolver
|
||||
{
|
||||
|
|
|
@ -31,6 +31,9 @@ use function strlen;
|
|||
use Symfony\Component\Asset\Packages;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
|
||||
/**
|
||||
* @see \App\Tests\Services\Attachments\AttachmentURLGeneratorTest
|
||||
*/
|
||||
class AttachmentURLGenerator
|
||||
{
|
||||
protected string $public_path;
|
||||
|
|
|
@ -30,6 +30,7 @@ use Symfony\Contracts\Cache\CacheInterface;
|
|||
|
||||
/**
|
||||
* This service is used to find builtin attachment ressources.
|
||||
* @see \App\Tests\Services\Attachments\BuiltinAttachmentsFinderTest
|
||||
*/
|
||||
class BuiltinAttachmentsFinder
|
||||
{
|
||||
|
@ -57,7 +58,7 @@ class BuiltinAttachmentsFinder
|
|||
foreach($finder as $file) {
|
||||
$folder = $file->getRelativePath();
|
||||
//Normalize path (replace \ with /)
|
||||
$folder = str_replace('\\', '/', $folder);
|
||||
$folder = str_replace('\\', '/', (string) $folder);
|
||||
|
||||
if(!isset($output[$folder])) {
|
||||
$output[$folder] = [];
|
||||
|
|
|
@ -32,6 +32,7 @@ use Symfony\Contracts\Cache\ItemInterface;
|
|||
* A service that helps to work with filetype filters (based on the format <input type=file> accept uses).
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers for
|
||||
* more details.
|
||||
* @see \App\Tests\Services\Attachments\FileTypeFilterToolsTest
|
||||
*/
|
||||
class FileTypeFilterTools
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue