Added placeholders for Part lots.

This commit is contained in:
Jan Böhmer 2020-04-17 21:10:08 +02:00
parent a4e1a17b4a
commit 16c1f84eb3
7 changed files with 226 additions and 4 deletions

View file

@ -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));
}
}