mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-28 13:58:31 +02:00
Started adding basic tests for LogEntryRepository
This commit is contained in:
parent
8fdf37261d
commit
204178740c
4 changed files with 213 additions and 0 deletions
|
@ -73,6 +73,7 @@ class PartFixtures extends Fixture implements DependentFixtureInterface
|
|||
$part = new Part();
|
||||
$part->setName('Part 1');
|
||||
$part->setCategory($manager->find(Category::class, 1));
|
||||
$this->addReference(Part::class . '_1', $part);
|
||||
$manager->persist($part);
|
||||
|
||||
/** More complex part */
|
||||
|
@ -86,6 +87,7 @@ class PartFixtures extends Fixture implements DependentFixtureInterface
|
|||
$part->setIpn('IPN123');
|
||||
$part->setNeedsReview(true);
|
||||
$part->setManufacturingStatus(ManufacturingStatus::ACTIVE);
|
||||
$this->addReference(Part::class . '_2', $part);
|
||||
$manager->persist($part);
|
||||
|
||||
/** Part with orderdetails, storelocations and Attachments */
|
||||
|
@ -98,6 +100,7 @@ class PartFixtures extends Fixture implements DependentFixtureInterface
|
|||
$partLot1->setStorageLocation($manager->find(StorageLocation::class, 1));
|
||||
$part->addPartLot($partLot1);
|
||||
|
||||
|
||||
$partLot2 = new PartLot();
|
||||
$partLot2->setExpirationDate(new \DateTimeImmutable());
|
||||
$partLot2->setComment('Test');
|
||||
|
@ -133,6 +136,8 @@ class PartFixtures extends Fixture implements DependentFixtureInterface
|
|||
$attachment->setAttachmentType($manager->find(AttachmentType::class, 1));
|
||||
$part->addAttachment($attachment);
|
||||
|
||||
$this->addReference(Part::class . '_3', $part);
|
||||
|
||||
$manager->persist($part);
|
||||
$manager->flush();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue