mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-24 11:59:31 +00:00
Renamed dto to make their relation to batch searches more clear
This commit is contained in:
parent
16126c4000
commit
92cd645945
9 changed files with 53 additions and 54 deletions
|
|
@ -659,8 +659,8 @@ class BulkInfoProviderImportControllerTest extends WebTestCase
|
|||
|
||||
// Create field mappings to verify the service works
|
||||
$fieldMappings = [
|
||||
new \App\Services\InfoProviderSystem\DTOs\FieldMappingDTO('name', ['test'], 1),
|
||||
new \App\Services\InfoProviderSystem\DTOs\FieldMappingDTO('mpn', ['test'], 2)
|
||||
new \App\Services\InfoProviderSystem\DTOs\BulkSearchFieldMappingDTO('name', ['test'], 1),
|
||||
new \App\Services\InfoProviderSystem\DTOs\BulkSearchFieldMappingDTO('mpn', ['test'], 2)
|
||||
];
|
||||
|
||||
// The service may return an empty result or throw when no results are found
|
||||
|
|
@ -790,8 +790,8 @@ class BulkInfoProviderImportControllerTest extends WebTestCase
|
|||
|
||||
// Create field mappings with supplier SPN field mapping
|
||||
$fieldMappings = [
|
||||
new \App\Services\InfoProviderSystem\DTOs\FieldMappingDTO('invalid_field', ['test'], 1),
|
||||
new \App\Services\InfoProviderSystem\DTOs\FieldMappingDTO('test_supplier_spn', ['test'], 2)
|
||||
new \App\Services\InfoProviderSystem\DTOs\BulkSearchFieldMappingDTO('invalid_field', ['test'], 1),
|
||||
new \App\Services\InfoProviderSystem\DTOs\BulkSearchFieldMappingDTO('test_supplier_spn', ['test'], 2)
|
||||
];
|
||||
|
||||
// The service should be able to process the request and throw an exception when no results are found
|
||||
|
|
@ -821,7 +821,7 @@ class BulkInfoProviderImportControllerTest extends WebTestCase
|
|||
|
||||
// Create field mappings with multiple keywords
|
||||
$fieldMappings = [
|
||||
new \App\Services\InfoProviderSystem\DTOs\FieldMappingDTO('name', ['lcsc'], 1)
|
||||
new \App\Services\InfoProviderSystem\DTOs\BulkSearchFieldMappingDTO('name', ['lcsc'], 1)
|
||||
];
|
||||
|
||||
// The service should be able to process the request and throw an exception when no results are found
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ namespace App\Tests\Services\InfoProviderSystem\DTOs;
|
|||
use App\Doctrine\Types\BulkSearchResponseDTOType;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Services\InfoProviderSystem\DTOs\BulkSearchResponseDTO;
|
||||
use App\Services\InfoProviderSystem\DTOs\BulkSearchResultDTO;
|
||||
use App\Services\InfoProviderSystem\DTOs\PartSearchResultsDTO;
|
||||
use App\Services\InfoProviderSystem\DTOs\BulkSearchPartResultDTO;
|
||||
use App\Services\InfoProviderSystem\DTOs\BulkSearchPartResultsDTO;
|
||||
use App\Services\InfoProviderSystem\DTOs\SearchResultDTO;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -45,14 +45,14 @@ class BulkSearchResponseDTOTest extends KernelTestCase
|
|||
|
||||
$this->dummyEmpty = new BulkSearchResponseDTO(partResults: []);
|
||||
$this->dummy = new BulkSearchResponseDTO(partResults: [
|
||||
new PartSearchResultsDTO(
|
||||
new BulkSearchPartResultsDTO(
|
||||
part: $this->entityManager->find(Part::class, 1),
|
||||
searchResults: [
|
||||
new BulkSearchResultDTO(
|
||||
new BulkSearchPartResultDTO(
|
||||
searchResult: new SearchResultDTO(provider_key: "dummy", provider_id: "1234", name: "Test Part", description: "A part for testing"),
|
||||
sourceField: "mpn", sourceKeyword: "1234", priority: 1
|
||||
),
|
||||
new BulkSearchResultDTO(
|
||||
new BulkSearchPartResultDTO(
|
||||
searchResult: new SearchResultDTO(provider_key: "test", provider_id: "test", name: "Test Part2", description: "A part for testing"),
|
||||
sourceField: "name", sourceKeyword: "1234",
|
||||
localPart: $this->entityManager->find(Part::class, 2), priority: 2,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue