mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +02:00
Fixed phpunit tests
This commit is contained in:
parent
d10d29e590
commit
afcbbe0f43
5 changed files with 11 additions and 8 deletions
|
@ -46,6 +46,7 @@ use App\Entity\Attachments\PartAttachment;
|
|||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Footprint;
|
||||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\ManufacturingStatus;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
|
@ -83,7 +84,7 @@ class PartFixtures extends Fixture implements DependentFixtureInterface
|
|||
$part->setTags('test, Test, Part2');
|
||||
$part->setMass(100.2);
|
||||
$part->setNeedsReview(true);
|
||||
$part->setManufacturingStatus('active');
|
||||
$part->setManufacturingStatus(ManufacturingStatus::ACTIVE);
|
||||
$manager->persist($part);
|
||||
|
||||
/** Part with orderdetails, storelocations and Attachments */
|
||||
|
|
|
@ -46,6 +46,7 @@ use App\Entity\LabelSystem\LabelSupportedElement;
|
|||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Footprint;
|
||||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\ManufacturingStatus;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
|
@ -79,7 +80,7 @@ final class LabelExampleElementsGenerator
|
|||
$part->setMass(123.4);
|
||||
$part->setManufacturerProductNumber('CUSTOM MPN');
|
||||
$part->setTags('Tag1, Tag2, Tag3');
|
||||
$part->setManufacturingStatus('active');
|
||||
$part->setManufacturingStatus(ManufacturingStatus::ACTIVE);
|
||||
$part->updateTimestamps();
|
||||
|
||||
$part->setFavorite(true);
|
||||
|
|
|
@ -105,11 +105,11 @@ final class PartProvider implements PlaceholderProviderInterface
|
|||
}
|
||||
|
||||
if ('[[M_STATUS]]' === $placeholder) {
|
||||
if ('' === $part->getManufacturingStatus()) {
|
||||
if (null === $part->getManufacturingStatus()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->translator->trans('m_status.'.$part->getManufacturingStatus());
|
||||
return $this->translator->trans($part->getManufacturingStatus()->toTranslationKey());
|
||||
}
|
||||
|
||||
$parsedown = new Parsedown();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue