mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 10:24:31 +02:00
Added placeholders for Part lots.
This commit is contained in:
parent
a4e1a17b4a
commit
16c1f84eb3
7 changed files with 226 additions and 4 deletions
|
@ -21,6 +21,7 @@
|
|||
namespace App\Tests\Services\LabelSystem;
|
||||
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Services\AmountFormatter;
|
||||
use App\Services\LabelSystem\LabelTextReplacer;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
@ -94,4 +95,18 @@ class LabelTextReplacerTest extends WebTestCase
|
|||
{
|
||||
$this->assertSame($expected, $this->service->replace($input, $this->target));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if the part lot has the highest priority of all providers.
|
||||
*/
|
||||
public function testPartLotPriority(): void
|
||||
{
|
||||
$part_lot = new PartLot();
|
||||
$part_lot->setDescription('Test');
|
||||
$part = new Part();
|
||||
$part->setName('Part');
|
||||
$part_lot->setPart($part);
|
||||
|
||||
$this->assertSame('Part', $this->service->handlePlaceholder('%%NAME%%', $part_lot));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue